* [patch] isdn: cleanup: make buffer smaller
@ 2010-09-04 18:33 Dan Carpenter
2010-09-07 1:30 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-09-04 18:33 UTC (permalink / raw)
To: Karsten Keil; +Cc: David S. Miller, Tilman Schmidt, netdev, kernel-janitors
This showed up in my audit because we use strcpy() to copy "ds" into a
32 character buffer inside the isdn_tty_dial() function. But it turns
out that we only ever use the first 32 characters so it's OK. I have
changed the declaration to make the static checkers happy.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c
index 51dc60d..f013ee1 100644
--- a/drivers/isdn/i4l/isdn_tty.c
+++ b/drivers/isdn/i4l/isdn_tty.c
@@ -3515,7 +3515,7 @@ isdn_tty_parse_at(modem_info * info)
{
atemu *m = &info->emu;
char *p;
- char ds[40];
+ char ds[ISDN_MSNLEN];
#ifdef ISDN_DEBUG_AT
printk(KERN_DEBUG "AT: '%s'\n", m->mdmcmd);
@@ -3594,7 +3594,7 @@ isdn_tty_parse_at(modem_info * info)
break;
case '3':
p++;
- sprintf(ds, "\r\n%d", info->emu.charge);
+ snprintf(ds, sizeof(ds), "\r\n%d", info->emu.charge);
isdn_tty_at_cout(ds, info);
break;
default:;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] isdn: cleanup: make buffer smaller
2010-09-04 18:33 [patch] isdn: cleanup: make buffer smaller Dan Carpenter
@ 2010-09-07 1:30 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-09-07 1:30 UTC (permalink / raw)
To: error27; +Cc: isdn, tilman, netdev, kernel-janitors
From: Dan Carpenter <error27@gmail.com>
Date: Sat, 4 Sep 2010 20:33:03 +0200
> This showed up in my audit because we use strcpy() to copy "ds" into a
> 32 character buffer inside the isdn_tty_dial() function. But it turns
> out that we only ever use the first 32 characters so it's OK. I have
> changed the declaration to make the static checkers happy.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-07 1:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-04 18:33 [patch] isdn: cleanup: make buffer smaller Dan Carpenter
2010-09-07 1:30 ` David Miller
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).