Fixed URBDRC parsing error reported in #6024.

This commit is contained in:
akallabeth 2020-04-07 08:51:55 +02:00 committed by akallabeth
parent a9daba0190
commit de7ea07a3d
1 changed files with 4 additions and 4 deletions

View File

@ -352,13 +352,13 @@ static BOOL udevman_parse_device_addr(const char* str, size_t maxLen, UINT8* id1
{
unsigned long rc;
char s1[8] = { 0 };
char* s2;
char* s2 = strchr(str, sign);
size_t len = strnlen(str, maxLen);
size_t cpLen;
s2 = (strchr(str, sign)) + 1;
if (!s2)
return FALSE;
s2++;
cpLen = len - (strnlen(s2, len) + 1);
@ -386,14 +386,14 @@ static BOOL udevman_parse_device_pid_vid(const char* str, size_t maxLen, UINT16*
{
unsigned long rc;
char s1[8] = { 0 };
char* s2;
char* s2 = strchr(str, sign);
size_t len = strnlen(str, maxLen);
size_t cpLen;
s2 = (strchr(str, sign)) + 1;
if (!s2)
return FALSE;
s2++; /* We need the PID, not ':' */
cpLen = len - (strnlen(s2, len) + 1);
if (cpLen >= sizeof(s1))