mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[utils,string] fix freerdp_extract_key_value
reset errno before strtoul to avoid aborting due to a previous errno value from a different function call
This commit is contained in:
@@ -112,10 +112,12 @@ BOOL freerdp_extract_key_value(const char* str, UINT32* pkey, UINT32* pvalue)
|
||||
return FALSE;
|
||||
|
||||
char* end1 = NULL;
|
||||
errno = 0;
|
||||
unsigned long key = strtoul(str, &end1, 0);
|
||||
if ((errno != 0) || !end1 || (*end1 != '=') || (key > UINT32_MAX))
|
||||
return FALSE;
|
||||
|
||||
errno = 0;
|
||||
unsigned long val = strtoul(&end1[1], NULL, 0);
|
||||
if ((errno != 0) || (val > UINT32_MAX))
|
||||
return FALSE;
|
||||
|
||||
Reference in New Issue
Block a user