lkml.org 
[lkml]   [2006]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [Patch] Uninitialized variable in drivers/net/wan/syncppp.c
From
Date
hi,

On Thu, 2006-08-31 at 18:45 -0500, Paul Fulghum wrote:
> Valid LCP configuration requests can have zero options (len == 4).
> If the magic number option is not included in the LCP CFG REQ,
> then the magic number should be treated as zero.
>
> The correct fix is to initialize rmagic to zero before
> the if (len>4 && !sppp_lcp_conf_parse_options()) line.

Thanks for clarification. Here is an updated patch, which has the advantage
of also silencing the gcc warning.

For len equal to 4, we never call sppp_lcp_conf_parse_options(),
therefore rmagic does not get initialized.

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

--- linux-2.6.18-rc5/drivers/net/wan/syncppp.c.orig 2006-09-01 02:16:18.000000000 +0200
+++ linux-2.6.18-rc5/drivers/net/wan/syncppp.c 2006-09-01 02:16:40.000000000 +0200
@@ -469,7 +469,7 @@ static void sppp_lcp_input (struct sppp
struct net_device *dev = sp->pp_if;
int len = skb->len;
u8 *p, opt[6];
- u32 rmagic;
+ u32 rmagic = 0;

if (!pskb_may_pull(skb, sizeof(struct lcp_header))) {
if (sp->pp_flags & PP_DEBUG)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-09-01 02:29    [W:0.049 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site