summaryrefslogtreecommitdiffstats
path: root/net/ipv4/cipso_ipv4.c
diff options
context:
space:
mode:
authorroel kluin <roel.kluin@gmail.com>2008-10-29 20:55:53 +0100
committerPaul Moore <paul.moore@hp.com>2008-10-29 20:55:53 +0100
commit00af5c69598212cf6cd4ecb4ca89785118aeecad (patch)
tree5e5039bb3083046680aa542f242f1eda6658028a /net/ipv4/cipso_ipv4.c
parentMerge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/... (diff)
downloadlinux-00af5c69598212cf6cd4ecb4ca89785118aeecad.tar.xz
linux-00af5c69598212cf6cd4ecb4ca89785118aeecad.zip
cipso: unsigned buf_len cannot be negative
unsigned buf_len cannot be negative Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Paul Moore <paul.moore@hp.com>
Diffstat (limited to 'net/ipv4/cipso_ipv4.c')
-rw-r--r--net/ipv4/cipso_ipv4.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 490e035c6d90..2e78f6bd9775 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -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