From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1W7Ayv-0001sR-6N for mharc-grub-devel@gnu.org; Sat, 25 Jan 2014 16:41:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58130) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Ayl-0001s6-LE for grub-devel@gnu.org; Sat, 25 Jan 2014 16:41:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7Ayc-0000A4-WA for grub-devel@gnu.org; Sat, 25 Jan 2014 16:41:27 -0500 Received: from mail-lb0-x230.google.com ([2a00:1450:4010:c04::230]:64522) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7Ayc-0000A0-Of for grub-devel@gnu.org; Sat, 25 Jan 2014 16:41:18 -0500 Received: by mail-lb0-f176.google.com with SMTP id w7so3456797lbi.21 for ; Sat, 25 Jan 2014 13:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=papgvt55hiMj+6/TtOO96R3plGjIhLLXFG4hO/xuwFI=; b=0CVBrFGfRhpQZCHeod5j2NIWK0i0aTedF2oBtEfNbwz0pIvNXt2/HxqNlXzwu5qTJF oW912b67VQc7IBNb4UH+zOEUwD3i/PKj/HZzkwIjFYu7kY6j1c5psY7jnwjxGsECJyEC Lj8CWYlyRtqi5BOlbaWcmgg15tMm0m3fbOyqbsPBYijciWv5EhDMwXbJ4SXVvcwT9EQl 2tawFDg8BRnjqjZmye0mKmeaFwcg4Sq6DJNnCsMvLHWKJLDH38nwAS7R5QYwfe/ujiNd PvEpphYD2fbebicueNHihr7CJIqhvCir8Nvc9ds6qtsDRrbRwzYaXQG/E9auPs/HZAoC iX0Q== X-Received: by 10.152.161.168 with SMTP id xt8mr75790lab.81.1390686077493; Sat, 25 Jan 2014 13:41:17 -0800 (PST) Received: from localhost.localdomain (ppp91-76-154-95.pppoe.mtu-net.ru. [91.76.154.95]) by mx.google.com with ESMTPSA id h7sm6120279lbj.1.2014.01.25.13.41.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 25 Jan 2014 13:41:17 -0800 (PST) From: Andrey Borzenkov To: grub-devel@gnu.org Subject: [PATCH] fix crash in CLI on empty line with continuation Date: Sun, 26 Jan 2014 01:41:13 +0400 Message-Id: <1390686073-25086-1-git-send-email-arvidjaar@gmail.com> X-Mailer: git-send-email 1.8.4 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c04::230 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: Sat, 25 Jan 2014 21:41:36 -0000 GRUB would crash when getting the following (without quotes) "\RETURN "RETURN This results in empty args. OTOH having empty first argument is not really a problem (it simply fails to find empty command name). --- grub-core/script/execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/script/execute.c b/grub-core/script/execute.c index afd5513..6ef12a0 100644 --- a/grub-core/script/execute.c +++ b/grub-core/script/execute.c @@ -920,7 +920,7 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) struct grub_script_argv argv = { 0, 0, 0 }; /* Lookup the command. */ - if (grub_script_arglist_to_argv (cmdline->arglist, &argv) || ! argv.args[0]) + if (grub_script_arglist_to_argv (cmdline->arglist, &argv) || ! argv.args) return grub_errno; invert = 0; -- tg: (5ae584c..) u/zero_args_crash (depends on: master)