From 3af0410a6e90fea0397272a21255c949a4e130f9 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Wed, 30 Sep 2026 12:26:37 +0200 Subject: [PATCH] Restrict parse value to strtoll with restrictions on input. --- src/rpc/parse.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/rpc/parse.cc b/src/rpc/parse.cc index 83ab5932..7a41f9ea 100644 --- a/src/rpc/parse.cc +++ b/src/rpc/parse.cc @@ -134,6 +134,9 @@ parse_value_nothrow(const char* src, int64_t* value, int base, int unit) { return first; } + if (base == 10 && src[0] == '0' && (src[1] >= '0' && src[1] <= '9')) + return first; + char* last{}; errno = 0;