From patchwork Sat Mar 19 04:26:10 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Hutchings X-Patchwork-Id: 645851 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2J4QHJw002078 for ; Sat, 19 Mar 2011 04:26:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751183Ab1CSE0P (ORCPT ); Sat, 19 Mar 2011 00:26:15 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:33295 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750938Ab1CSE0P convert rfc822-to-8bit (ORCPT ); Sat, 19 Mar 2011 00:26:15 -0400 Received: from [2001:470:1f08:1539:21c:bfff:fe03:f805] (helo=localhost) by shadbolt.i.decadent.org.uk with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1Q0njv-00068w-JT; Sat, 19 Mar 2011 04:26:12 +0000 Received: from ben by localhost with local (Exim 4.74) (envelope-from ) id 1Q0nju-0001eQ-JD; Sat, 19 Mar 2011 04:26:10 +0000 From: Ben Hutchings To: Roman Zippel Cc: linux-kbuild@vger.kernel.org Date: Sat, 19 Mar 2011 04:26:10 +0000 Message-ID: <1300508770.26693.73.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 X-SA-Exim-Connect-IP: 2001:470:1f08:1539:21c:bfff:fe03:f805 X-SA-Exim-Mail-From: ben@decadent.org.uk X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on shadbolt.decadent.org.uk X-Spam-Level: **** X-Spam-Status: No, score=4.9 required=5.0 tests=FSL_HELO_NON_FQDN_1, HELO_LOCALHOST,RDNS_NONE autolearn=disabled version=3.3.1 Subject: [PATCH] kconfig: Avoid buffer underrun in choice input X-SA-Exim-Version: 4.2.1 (built Mon, 22 Mar 2010 06:51:10 +0000) X-SA-Exim-Scanned: Yes (on shadbolt.i.decadent.org.uk) Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 19 Mar 2011 04:26:18 +0000 (UTC) diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index 659326c..006ad81 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -332,7 +332,7 @@ static int conf_choice(struct menu *menu) } if (!child) continue; - if (line[strlen(line) - 1] == '?') { + if (line[0] && line[strlen(line) - 1] == '?') { print_help(child); continue; }