From 2df1255117a7facc7e88b7dfbecb915124dda10a Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sat, 9 Nov 2013 17:31:21 +0100 Subject: [PATCH] * grub-core/lib/cmdline.c (grub_loader_cmdline_size): Fix empty cmdline handling. --- ChangeLog | 5 +++++ grub-core/lib/cmdline.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index dfb1013c7..18ae47e54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-11-09 Vladimir Serbinenko + + * grub-core/lib/cmdline.c (grub_loader_cmdline_size): Fix empty cmdline + handling. + 2013-11-09 Vladimir Serbinenko * grub-core/commands/i386/cmostest.c: Add new command "cmosset". diff --git a/grub-core/lib/cmdline.c b/grub-core/lib/cmdline.c index a702e6487..d5e10ee87 100644 --- a/grub-core/lib/cmdline.c +++ b/grub-core/lib/cmdline.c @@ -56,6 +56,9 @@ unsigned int grub_loader_cmdline_size (int argc, char *argv[]) size++; /* Separator space or NULL. */ } + if (size == 0) + size = 1; + return size; }