]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
cipso: unsigned buf_len cannot be negative
authorroel kluin <roel.kluin@gmail.com>
Wed, 29 Oct 2008 19:55:53 +0000 (15:55 -0400)
committerPaul Moore <paul.moore@hp.com>
Wed, 29 Oct 2008 19:55:53 +0000 (15:55 -0400)
unsigned buf_len cannot be negative

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Moore <paul.moore@hp.com>
net/ipv4/cipso_ipv4.c

index 490e035c6d90d231aee5514ac8d4a3f262ef0a4d..2e78f6bd97756db7920367e5fe07ce23e6cd6eb7 100644 (file)
@@ -2063,9 +2063,10 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb,
        u32 opt_len;
        int len_delta;
 
-       buf_len = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
-       if (buf_len < 0)
-               return buf_len;
+       ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
+       if (ret_val < 0)
+               return ret_val;
+       buf_len = ret_val;
        opt_len = (buf_len + 3) & ~3;
 
        /* we overwrite any existing options to ensure that we have enough