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>
This commit is contained in:
parent
f205a07363
commit
3468dda9c3
|
@ -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…
Reference in New Issue