diff --git a/src/q931_decode.c b/src/q931_decode.c index 9dd3c62..ea55f02 100644 --- a/src/q931_decode.c +++ b/src/q931_decode.c @@ -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;