public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Paul Moore <paul.moore@hp•com>
To: netdev@vger•kernel.org
Subject: [PATCH 1/3] cipso: unsigned buf_len cannot be negative
Date: Thu, 30 Oct 2008 13:10:19 -0400	[thread overview]
Message-ID: <20081030171019.11396.40616.stgit@flek.lan> (raw)
In-Reply-To: <20081030170736.11396.46099.stgit@flek.lan>

From: roel kluin <roel.kluin@gmail•com>

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 |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 490e035..2e78f6b 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


  reply	other threads:[~2008-10-30 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-30 17:10 [GIT PULL] Labeled networking fixes for 2.6.28 Paul Moore
2008-10-30 17:10 ` Paul Moore [this message]
2008-10-30 17:10 ` [PATCH 2/3] netlabel: Fix compiler warnings in netlabel_mgmt.c Paul Moore
2008-10-30 17:10 ` [PATCH 3/3] netlabel: Fix compilation warnings in net/netlabel/netlabel_addrlist.c Paul Moore
2008-10-31  6:57 ` [GIT PULL] Labeled networking fixes for 2.6.28 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081030171019.11396.40616.stgit@flek.lan \
    --to=paul.moore@hp$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox