From: Karel Zak Date: Wed, 26 Oct 2016 12:01:29 +0000 (+0200) Subject: libfdisk: (script) make bootable flag parsing more robust X-Git-Tag: v2.29~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=469acdb4496de69d69344def0adaba3176da7c1e;p=thirdparty%2Futil-linux.git libfdisk: (script) make bootable flag parsing more robust Signed-off-by: Karel Zak --- diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c index e90c18ab07..ae7e99a143 100644 --- a/libfdisk/src/script.c +++ b/libfdisk/src/script.c @@ -911,8 +911,9 @@ static int parse_line_nameval(struct fdisk_script *dp, char *s) } } else if (!strncasecmp(p, "bootable", 8)) { + /* we use next_token() to skip possible extra space */ char *tk = next_token(&p); - if (strcmp(tk, "bootable") == 0) + if (tk && strcasecmp(tk, "bootable") == 0) pa->boot = 1; else rc = -EINVAL;