Skip to content

Commit

Permalink
cipso: unsigned buf_len cannot be negative
Browse files Browse the repository at this point in the history
unsigned buf_len cannot be negative

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Paul Moore <paul.moore@hp.com>
  • Loading branch information
RoelKluin authored and pcmoore committed Oct 29, 2008
1 parent e946217 commit 00af5c6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/ipv4/cipso_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00af5c6

Please sign in to comment.