]> err.no Git - linux-2.6/commitdiff
[NETFILTER]: Fix warnings in ip_nat_snmp_basic.c
authorDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 06:36:21 +0000 (22:36 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Mar 2006 06:36:21 +0000 (22:36 -0800)
net/ipv4/netfilter/ip_nat_snmp_basic.c: In function 'asn1_header_decode':
net/ipv4/netfilter/ip_nat_snmp_basic.c:248: warning: 'len' may be used uninitialized in this function
net/ipv4/netfilter/ip_nat_snmp_basic.c:248: warning: 'def' may be used uninitialized in this function
net/ipv4/netfilter/ip_nat_snmp_basic.c: In function 'snmp_translate':
net/ipv4/netfilter/ip_nat_snmp_basic.c:672: warning: 'l' may be used uninitialized in this function
net/ipv4/netfilter/ip_nat_snmp_basic.c:668: warning: 'type' may be used uninitialized in this function

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/netfilter/ip_nat_snmp_basic.c

index 4f95d477805c051628ac2ee2fdf440d37f0b6e1c..f029da2a60ee6cb288a9ab91f5554be283521c61 100644 (file)
@@ -250,6 +250,7 @@ static unsigned char asn1_header_decode(struct asn1_ctx *ctx,
        if (!asn1_id_decode(ctx, cls, con, tag))
                return 0;
                
+       def = len = 0;
        if (!asn1_length_decode(ctx, &def, &len))
                return 0;
                
@@ -669,7 +670,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
        unsigned char *eoc, *end, *p;
        unsigned long *lp, *id;
        unsigned long ul;
-       long  l;
+       long l;
        
        *obj = NULL;
        id = NULL;
@@ -699,11 +700,13 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx,
                return 0;
        }
        
+       type = 0;
        if (!snmp_tag_cls2syntax(tag, cls, &type)) {
                kfree(id);
                return 0;
        }
        
+       l = 0;
        switch (type) {
                case SNMP_INTEGER:
                        len = sizeof(long);