q931_decode: ensure compare operations are entirely unsigned

This commit is contained in:
Harald Welte 2022-10-16 17:07:21 +02:00
parent 4bbe07563d
commit ba1def7bfb
1 changed files with 2 additions and 2 deletions

View File

@ -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;