libfdisk: (script) fix segmentation fault

This patch fixes a segmentation fault that occurs if the name value is
empty (i.e. name=).

Signed-off-by: Gaël PORTAY <gael.portay@collabora.com>
pull/989/head
Gaël PORTAY 3 years ago
parent f205a07363
commit 3468dda9c3
  1. 3
      libfdisk/src/script.c

@ -1059,7 +1059,8 @@ static int parse_line_nameval(struct fdisk_script *dp, char *s)
} else if (!strncasecmp(p, "name=", 5)) {
p += 5;
rc = next_string(&p, &pa->name);
unhexmangle_string(pa->name);
if (!rc)
unhexmangle_string(pa->name);
} else if (!strncasecmp(p, "type=", 5) ||
!strncasecmp(p, "Id=", 3)) { /* backward compatibility */

Loading…
Cancel
Save