Skip to content

Commit c2b9b4f

Browse files
codeslingerummakynes
authored andcommitted
netfilter: nf_conntrack_h323: fix off-by-one in DecodeQ931
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 <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent c080b46 commit c2b9b4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/netfilter/nf_conntrack_h323_asn1.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,9 +846,10 @@ int DecodeQ931(unsigned char *buf, size_t sz, Q931 *q931)
846846
sz -= len;
847847

848848
/* Message Type */
849-
if (sz < 1)
849+
if (sz < 2)
850850
return H323_ERROR_BOUND;
851851
q931->MessageType = *p++;
852+
sz--;
852853
PRINT("MessageType = %02X\n", q931->MessageType);
853854
if (*p & 0x80) {
854855
p++;

0 commit comments

Comments
 (0)