All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len
@ 2013-10-03 17:25 Martin Walch
  2013-10-05 17:54 ` Wang YanQing
  2013-10-07 13:43 ` Benjamin Poirier
  0 siblings, 2 replies; 3+ messages in thread
From: Martin Walch @ 2013-10-03 17:25 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Michal Marek, Arve Hjønnevåg, Jiri Kosina,
	Yann E. MORIN, Benjamin Poirier, Dirk Gouders, Wang YanQing,
	Andrew Morton, Jean Delvare, Kees Cook, linux-kernel

From: Martin Walch <walch.martin@web.de>
Date: Thu, 3 Oct 2013 18:35:16 +0200
Subject: [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len

The struct gstr has a capacity that may differ from the actual string length.

However, a string manipulation in the function search_conf made the assumption
that it is the same, which led to messing up some search results, especially
when the content of the gstr in use had not yet reached at least 63 chars.

Signed-off-by: Martin Walch <walch.martin@web.de>
---
 scripts/kconfig/menu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index 9e69f19..db1512a 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -584,7 +584,7 @@ static void get_prompt_str(struct gstr *r, struct property *prop,
 		for (j = 4; --i >= 0; j += 2) {
 			menu = submenu[i];
 			if (head && location && menu == location)
-				jump->offset = r->len - 1;
+				jump->offset = strlen(r->s);
 			str_printf(r, "%*c-> %s", j, ' ',
 				   _(menu_get_prompt(menu)));
 			if (menu->sym) {
-- 
1.8.1.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len
  2013-10-03 17:25 [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len Martin Walch
@ 2013-10-05 17:54 ` Wang YanQing
  2013-10-07 13:43 ` Benjamin Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Wang YanQing @ 2013-10-05 17:54 UTC (permalink / raw)
  To: Martin Walch
  Cc: linux-kbuild, Michal Marek, Arve Hjønnevåg,
	Jiri Kosina, Yann E. MORIN, Benjamin Poirier, Dirk Gouders,
	Andrew Morton, Jean Delvare, Kees Cook, linux-kernel

On Thu, Oct 03, 2013 at 07:25:53PM +0200, Martin Walch wrote:
> From: Martin Walch <walch.martin@web.de>
> Date: Thu, 3 Oct 2013 18:35:16 +0200
> Subject: [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len
> 
> The struct gstr has a capacity that may differ from the actual string length.
> 
> However, a string manipulation in the function search_conf made the assumption
> that it is the same, which led to messing up some search results, especially
> when the content of the gstr in use had not yet reached at least 63 chars.
> 
> Signed-off-by: Martin Walch <walch.martin@web.de>
Acked-by: Wang YanQing <udknight@gmail.com>

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len
  2013-10-03 17:25 [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len Martin Walch
  2013-10-05 17:54 ` Wang YanQing
@ 2013-10-07 13:43 ` Benjamin Poirier
  1 sibling, 0 replies; 3+ messages in thread
From: Benjamin Poirier @ 2013-10-07 13:43 UTC (permalink / raw)
  To: Martin Walch
  Cc: linux-kbuild, Michal Marek, Arve Hjønnevåg,
	Jiri Kosina, Yann E. MORIN, Dirk Gouders, Wang YanQing,
	Andrew Morton, Jean Delvare, Kees Cook, linux-kernel

On 2013/10/03 19:25, Martin Walch wrote:
> From: Martin Walch <walch.martin@web.de>
> Date: Thu, 3 Oct 2013 18:35:16 +0200
> Subject: [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len
> 

Good catch, thank you.

Acked-by: Benjamin Poirier <bpoirier@suse.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-07 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-03 17:25 [PATCH v2 5/5] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len Martin Walch
2013-10-05 17:54 ` Wang YanQing
2013-10-07 13:43 ` Benjamin Poirier

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.