Merge pull request #10798 from akallabeth/kbd-remap-fix
[utils,string] fix freerdp_extract_key_value
This commit is contained in:
commit
a7638bb0e4
@ -112,10 +112,12 @@ BOOL freerdp_extract_key_value(const char* str, UINT32* pkey, UINT32* pvalue)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
char* end1 = NULL;
|
char* end1 = NULL;
|
||||||
|
errno = 0;
|
||||||
unsigned long key = strtoul(str, &end1, 0);
|
unsigned long key = strtoul(str, &end1, 0);
|
||||||
if ((errno != 0) || !end1 || (*end1 != '=') || (key > UINT32_MAX))
|
if ((errno != 0) || !end1 || (*end1 != '=') || (key > UINT32_MAX))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
errno = 0;
|
||||||
unsigned long val = strtoul(&end1[1], NULL, 0);
|
unsigned long val = strtoul(&end1[1], NULL, 0);
|
||||||
if ((errno != 0) || (val > UINT32_MAX))
|
if ((errno != 0) || (val > UINT32_MAX))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user