When result is int. Then there is an overflow in 16bit devices.
This will need to be pushed to upstream to wakama public repo via standard submission process.
Also should investigate if uriString[*headP] != '/' is correc. Check if prv_parseNumber() get uriString with / as the break char.
static int prv_parseNumber(uint8_t * uriString,
size_t uriLength,
size_t * headP)
{
uint32_t result = 0;
if (uriString[*headP] == '/')
{
// empty Object Instance ID with resource ID is not allowed
return -1;
}
while (*headP < uriLength && uriString[*headP] != '/')
{
if ('0' <= uriString[*headP] && uriString[*headP] <= '9')
{
result += uriString[*headP] - '0';
result *= 10;
}
else
{
return -1;
}
*headP += 1;
}
result /= 10;
return result;
}
The corrected code is below.
When
result
is int. Then there is an overflow in 16bit devices. This will need to be pushed to upstream to wakama public repo via standard submission process.Also should investigate if
uriString[*headP] != '/'
is correc. Check ifprv_parseNumber()
get uriString with/
as the break char.