Skip to content

Commit

Permalink
netfilter: nf_conntrack_h323: fix off-by-one in DecodeQ931
Browse files Browse the repository at this point in the history
This patch corrects an off-by-one error in the DecodeQ931 function in
the nf_conntrack_h323 module. This error could result in reading off
the end of a Q.931 frame.

Signed-off-by: Toby DiPasquale <toby@cbcg.net>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
  • Loading branch information
Toby DiPasquale authored and Pablo Neira Ayuso committed Jul 11, 2016
1 parent c080b46 commit c2b9b4f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/netfilter/nf_conntrack_h323_asn1.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,9 +846,10 @@ int DecodeQ931(unsigned char *buf, size_t sz, Q931 *q931)
sz -= len;

/* Message Type */
if (sz < 1)
if (sz < 2)
return H323_ERROR_BOUND;
q931->MessageType = *p++;
sz--;
PRINT("MessageType = %02X\n", q931->MessageType);
if (*p & 0x80) {
p++;
Expand Down

0 comments on commit c2b9b4f

Please sign in to comment.