All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn <snakebyte@gmx.de>
To: linux-kernel@vger.kernel.org
Subject: [Patch] Uninitialized variable in drivers/net/wan/syncppp.c
Date: Fri, 01 Sep 2006 01:13:22 +0200	[thread overview]
Message-ID: <1157066002.13592.3.camel@alice> (raw)

hi,

this was spotted by coverity (id #891), when
len is equal to 4, we dont call sppp_lcp_conf_parse_options(),
to initialize rmagic.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.18-rc5/drivers/net/wan/syncppp.c.orig	2006-09-01 00:55:08.000000000 +0200
+++ linux-2.6.18-rc5/drivers/net/wan/syncppp.c	2006-09-01 00:55:45.000000000 +0200
@@ -505,14 +505,15 @@ static void sppp_lcp_input (struct sppp 
 			skb->len, h);
 		break;
 	case LCP_CONF_REQ:
-		if (len < 4) {
+		if (len <= 4) {
 			if (sp->pp_flags & PP_DEBUG)
 				printk (KERN_DEBUG"%s: invalid lcp configure request packet length: %d bytes\n",
 					dev->name, len);
 			break;
 		}
-		if (len>4 && !sppp_lcp_conf_parse_options (sp, h, len, &rmagic))
+		if (!sppp_lcp_conf_parse_options (sp, h, len, &rmagic))
 			goto badreq;
+
 		if (rmagic == sp->lcp.magic) {
 			/* Local and remote magics equal -- loopback? */
 			if (sp->pp_loopcnt >= MAXALIVECNT*5) {



             reply	other threads:[~2006-08-31 23:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 23:13 Eric Sesterhenn [this message]
2006-08-31 23:45 ` [Patch] Uninitialized variable in drivers/net/wan/syncppp.c Paul Fulghum
2006-09-01  0:26   ` Eric Sesterhenn
2006-09-01  1:01     ` Paul Fulghum

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=1157066002.13592.3.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.