]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
netfilter: nf_nat_snmp_basic: fix a range check in NAT for SNMP
authorDavid Howells <dhowells@redhat.com>
Wed, 9 Jul 2008 22:06:45 +0000 (15:06 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 20 Aug 2008 18:15:45 +0000 (11:15 -0700)
commit 252815b0cfe711001eff0327872209986b36d490 upstream

Fix a range check in netfilter IP NAT for SNMP to always use a big enough size
variable that the compiler won't moan about comparing it to ULONG_MAX/8 on a
64-bit platform.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Cc: Eugene Teo <eteo@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/ipv4/netfilter/nf_nat_snmp_basic.c

index 5f35f0b589dbb3d0561e7e72e26d887b338186ab..8e4148d395151c9cb0c788871b5c956d3490b97e 100644 (file)
@@ -438,8 +438,8 @@ static unsigned char asn1_oid_decode(struct asn1_ctx *ctx,
                                     unsigned int *len)
 {
        unsigned long subid;
-       unsigned int  size;
        unsigned long *optr;
+       size_t size;
 
        size = eoc - ctx->pointer + 1;