Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757366AbbBQMBl (ORCPT ); Tue, 17 Feb 2015 07:01:41 -0500 Received: from ip4-83-240-67-251.cust.nbox.cz ([83.240.67.251]:39802 "EHLO ip4-83-240-18-248.cust.nbox.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756907AbbBQLfN (ORCPT ); Tue, 17 Feb 2015 06:35:13 -0500 From: Jiri Slaby To: stable@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Martin Walch , "Yann E. MORIN" , Jiri Slaby Subject: [PATCH 3.12 057/122] kconfig: fix bug in search results string: use strlen(gstr->s), not gstr->len Date: Tue, 17 Feb 2015 12:34:04 +0100 Message-Id: <1c2c26279c864adb131e0978556b2cfdc9ecabac.1424099973.git.jslaby@suse.cz> X-Mailer: git-send-email 2.2.2 In-Reply-To: <09e6fe32192a77f6e2e60cc0f4103e630c7ecf20.1424099973.git.jslaby@suse.cz> References: <09e6fe32192a77f6e2e60cc0f4103e630c7ecf20.1424099973.git.jslaby@suse.cz> In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1650 Lines: 45 From: Martin Walch 3.12-stable review patch. If anyone has any objections, please let me know. =============== commit 503c823048e81cc85c0e9d8c297cc70203e335e5 upstream. 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 Acked-by: Wang YanQing Acked-by: Benjamin Poirier Reviewed-by: "Yann E. MORIN" Signed-off-by: "Yann E. MORIN" Signed-off-by: Jiri Slaby --- 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 c1d53200c306..2b3317010ba4 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c @@ -583,7 +583,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) { -- 2.2.2 -- 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/