mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-15 15:16:49 +02:00
NumberParser::parseUnsigned should not parse negative numbers
The function should abort if a negative number (e.g. "-123") is passed as input
This commit is contained in:
@@ -110,6 +110,8 @@ bool strToInt(const char* pStr, I& result, short base, char thSep = ',')
|
||||
char sign = 1;
|
||||
if ((base == 10) && (*pStr == '-'))
|
||||
{
|
||||
// Unsigned types can't be negative so abort parsing
|
||||
if (std::numeric_limits<I>::min() >= 0) return false;
|
||||
sign = -1;
|
||||
++pStr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user