Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Ridbr-00072F-Br for mharc-grub-devel@gnu.org; Wed, 04 Jan 2012 22:03:19 -0500 Received: from eggs.gnu.org ([140.186.70.92]:42101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ridbq-000728-0u for grub-devel@gnu.org; Wed, 04 Jan 2012 22:03:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ridbo-0000sI-Q5 for grub-devel@gnu.org; Wed, 04 Jan 2012 22:03:17 -0500 Received: from rcsinet15.oracle.com ([148.87.113.117]:65156) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ridbo-0000s3-Kp for grub-devel@gnu.org; Wed, 04 Jan 2012 22:03:16 -0500 Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238]) by rcsinet15.oracle.com (Switch-3.4.4/Switch-3.4.4) with ESMTP id q0533C2g013305 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 5 Jan 2012 03:03:13 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q0533Bel025824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 5 Jan 2012 03:03:12 GMT Received: from abhmt102.oracle.com (abhmt102.oracle.com [141.146.116.54]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q0533Bqw016777 for ; Wed, 4 Jan 2012 21:03:11 -0600 Received: from bergsoft (/10.132.136.136) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 04 Jan 2012 19:03:11 -0800 Date: Wed, 4 Jan 2012 19:02:01 -0800 (PST) From: Seth Goldberg X-X-Sender: sethg@bergsoft To: grub-devel@gnu.org Subject: Bug in arg.c Message-ID: User-Agent: Alpine 2.00 (GSO 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Source-IP: acsinet22.oracle.com [141.146.126.238] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4F0512F1.005D,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 148.87.113.117 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jan 2012 03:03:18 -0000 Hi, If you supply an invalid long option with an argument, null pointer dereference will result. The fix is simple: --- a/grub-core/lib/arg.c Wed Jan 04 17:38:56 2012 -0800 +++ b/grub-core/lib/arg.c Wed Jan 04 18:59:08 2012 -0800 @@ -351,7 +351,7 @@ opt = find_long (cmd->options, arg + 2, arglen); if (!option && argv[curarg + 1] && argv[curarg + 1][0] != '-' - && opt->type != ARG_TYPE_NONE) + && opt && opt->type != ARG_TYPE_NONE) option = argv[++curarg]; if (!opt && (cmd->cmd->flags & GRUB_COMMAND_ACCEPT_DASH))