From: David Miller <davem@davemloft.net>
To: dan.carpenter@oracle.com
Cc: isdn@linux-pingi.de, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org, joe@perches.com
Subject: Re: [patch v2] isdn: icn: buffer overflow in icn_command()
Date: Wed, 16 Apr 2014 15:24:30 -0400 (EDT) [thread overview]
Message-ID: <20140416.152430.905344668036570538.davem@davemloft.net> (raw)
In-Reply-To: <20140416112516.GA12917@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 16 Apr 2014 14:25:16 +0300
> This buffer over was detected using static analysis:
>
> drivers/isdn/icn/icn.c:1325 icn_command()
> error: format string overflow. buf_size: 60 length: 98
>
> The calculation for the length of the string is off because it assumes
> that the dial[] buffer holds a 50 character string, but actually it is
> at most 31 characters and NUL. I have removed the dial[] buffer because
> it isn't needed.
>
> The maximum length of the string is actually 79 characters and a NUL. I
> have made the cbuf[] array large enough to hold it and changed the
> sprintf() to an snprintf() as a further safety enhancement.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks Dan.
prev parent reply other threads:[~2014-04-16 19:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-14 8:07 [patch] isdn: icn: buffer overflow in icn_command() Dan Carpenter
2014-04-14 15:52 ` Joe Perches
2014-04-16 11:16 ` Dan Carpenter
2014-04-16 11:47 ` Joe Perches
2014-04-16 11:25 ` [patch v2] " Dan Carpenter
2014-04-16 12:10 ` walter harms
2014-04-16 19:24 ` David Miller [this message]
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=20140416.152430.905344668036570538.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=dan.carpenter@oracle.com \
--cc=isdn@linux-pingi.de \
--cc=joe@perches.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).