q931_decode: ensure compare operations are entirely unsigned
This commit is contained in:
parent
4bbe07563d
commit
ba1def7bfb
|
@ -69,12 +69,12 @@ int q931_msg_parse(struct q931_msg_parsed *out, const uint8_t *buf, size_t len)
|
|||
|
||||
/* parse [variable length] call reference */
|
||||
cref_len = buf[1] & 0x0F;
|
||||
if (len < 2 + cref_len)
|
||||
if (len < 2U + cref_len)
|
||||
return -EMSGSIZE;
|
||||
out->call_ref = q931_decode_callref(buf+1, len-1);
|
||||
|
||||
/* parse message type */
|
||||
if (len < 2 + cref_len + 1)
|
||||
if (len < 2U + cref_len + 1U)
|
||||
return -EMSGSIZE;
|
||||
out->msg_type = buf[2+cref_len] & 0x7f;
|
||||
|
||||
|
|
Loading…
Reference in New Issue