From fa89652e68fc07fb6c9f3d9e34dc11d35f0cc1e1 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 15 May 2025 20:06:32 +0200 Subject: [PATCH] init: Reject + sign in -*port parsing It would be confusing to specify the sign for an unsigned value here, so reject it. --- src/init.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/init.cpp b/src/init.cpp index dfc0724adf1..388a21bc88b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1179,8 +1179,8 @@ bool CheckHostPortOptions(const ArgsManager& args) { "-rpcport", }) { if (const auto port{args.GetArg(port_option)}) { - uint16_t n; - if (!ParseUInt16(*port, &n) || n == 0) { + const auto n{ToIntegral(*port)}; + if (!n || *n == 0) { return InitError(InvalidPortErrMsg(port_option, *port)); } }