Commit b4232a22776aa5d063f890d21ca69870dbbe431b

Authored by David Sterba
Committed by Patrick McHardy
1 parent 2f9f28b212

netfilter: h323: bug in parsing of ASN1 SEQOF field

Static analyzer of clang found a dead store which appears to be a bug in
reading count of items in SEQOF field, only the lower byte of word is
stored. This may lead to corrupted read and communication shutdown.

The bug has been in the module since it's first inclusion into linux
kernel.

[Patrick: the bug is real, but without practical consequence since the
 largest amount of sequence-of members we parse is 30.]

Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Patrick McHardy <kaber@trash.net>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

net/netfilter/nf_conntrack_h323_asn1.c
... ... @@ -631,7 +631,7 @@
631 631 CHECK_BOUND(bs, 2);
632 632 count = *bs->cur++;
633 633 count <<= 8;
634   - count = *bs->cur++;
  634 + count += *bs->cur++;
635 635 break;
636 636 case SEMI:
637 637 BYTE_ALIGN(bs);