* [PATCH] nconfig: Fix segfault when help contains special characters
@ 2010-07-23 7:04 Stephen Boyd
2010-07-23 9:25 ` Michal Marek
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Boyd @ 2010-07-23 7:04 UTC (permalink / raw)
To: linux-kbuild; +Cc: linux-kernel, Michal Marek, Nir Tzachar
nconfig segfaults when help text contains the character '%'. For a quick
example, navigate to the kernel compression options and get the help for
bzip2. Doing so triggers a call to mvwprintw() with a string containing
'%' and no extra arguments to fill in the specifier's value. Fix this
case by printing the literal string retrieved from the kconfig.
#0 0x00002b52b6b11d83 in vfprintf () from /lib/libc.so.6
#1 0x00002b52b6bad010 in __vsnprintf_chk () from /lib/libc.so.6
#2 0x00002b52b623991b in _nc_printf_string () from
/lib/libncursesw.so.5
#3 0x00002b52b6234cff in vwprintw () from /lib/libncursesw.so.5
#4 0x00002b52b6234db9 in mvwprintw () from /lib/libncursesw.so.5
#5 0x00000000004151d8 in fill_window (win=0x21b64c0,
text=0x21b62b0 "CONFIG_KERNEL_BZIP2:\n\nIts compression ratio and
speed is intermediate.\nDecompression speed is slowest among the
three. The kernel\nsize is about 10% smaller with bzip2, in
comparison to gzip.\nBzip2 us"...)
at scripts/kconfig/nconf.gui.c:229
#6 0x0000000000416335 in show_scroll_win (main_window=0x21a5630,
title=0x157fa30 "Bzip2",
text=0x21b62b0 "CONFIG_KERNEL_BZIP2:\n\nIts compression
ratio and speed is intermediate.\nDecompression speed is
slowest among the three. The kernel\nsize is about 10%
smaller with bzip2, in comparison to gzip.\nBzip2 us"...)
at scripts/kconfig/nconf.gui.c:535
#7 0x00000000004055b2 in show_help (menu=0x157f9d0)
at scripts/kconfig/nconf.c:1257
#8 0x0000000000405897 in conf_choice (menu=0x157f130)
at scripts/kconfig/nconf.c:1321
#9 0x0000000000405326 in conf (menu=0x157d130) at
scripts/kconfig/nconf.c:1208
#10 0x00000000004052e8 in conf (menu=0xb434a0) at
scripts/kconfig/nconf.c:1203
#11 0x0000000000406092 in main (ac=2, av=0x7fff96a93c38)
Cc: Michal Marek <mmarek@suse.cz>
Cc: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
---
scripts/kconfig/nconf.gui.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/scripts/kconfig/nconf.gui.c b/scripts/kconfig/nconf.gui.c
index 115edb4..a9d9344 100644
--- a/scripts/kconfig/nconf.gui.c
+++ b/scripts/kconfig/nconf.gui.c
@@ -226,7 +226,7 @@ void fill_window(WINDOW *win, const char *text)
int len = get_line_length(line);
strncpy(tmp, line, min(len, x));
tmp[len] = '\0';
- mvwprintw(win, i, 0, tmp);
+ mvwprintw(win, i, 0, "%s", tmp);
}
}
--
1.7.2.rc3.57.g77b5b
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] nconfig: Fix segfault when help contains special characters
2010-07-23 7:04 [PATCH] nconfig: Fix segfault when help contains special characters Stephen Boyd
@ 2010-07-23 9:25 ` Michal Marek
2010-07-25 8:30 ` Nir Tzachar
0 siblings, 1 reply; 3+ messages in thread
From: Michal Marek @ 2010-07-23 9:25 UTC (permalink / raw)
To: Stephen Boyd; +Cc: linux-kbuild, linux-kernel, Nir Tzachar
On 23.7.2010 09:04, Stephen Boyd wrote:
> nconfig segfaults when help text contains the character '%'. For a quick
> example, navigate to the kernel compression options and get the help for
> bzip2. Doing so triggers a call to mvwprintw() with a string containing
> '%' and no extra arguments to fill in the specifier's value. Fix this
> case by printing the literal string retrieved from the kconfig.
Thanks, applied.
Michal
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nconfig: Fix segfault when help contains special characters
2010-07-23 9:25 ` Michal Marek
@ 2010-07-25 8:30 ` Nir Tzachar
0 siblings, 0 replies; 3+ messages in thread
From: Nir Tzachar @ 2010-07-25 8:30 UTC (permalink / raw)
To: Michal Marek; +Cc: Stephen Boyd, linux-kbuild, linux-kernel
2010/7/23 Michal Marek <mmarek@suse.cz>:
> On 23.7.2010 09:04, Stephen Boyd wrote:
>> nconfig segfaults when help text contains the character '%'. For a quick
>> example, navigate to the kernel compression options and get the help for
>> bzip2. Doing so triggers a call to mvwprintw() with a string containing
>> '%' and no extra arguments to fill in the specifier's value. Fix this
>> case by printing the literal string retrieved from the kconfig.
>
> Thanks, applied.
>
> Michal
Thanks. It is also nice to see people are using nconfig.
Cheers.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-25 8:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-23 7:04 [PATCH] nconfig: Fix segfault when help contains special characters Stephen Boyd
2010-07-23 9:25 ` Michal Marek
2010-07-25 8:30 ` Nir Tzachar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox