]> git.ipfire.org Git - thirdparty/util-linux.git/blobdiff - libfdisk/src/script.c
libfdisk: (script) fix segmentation fault
[thirdparty/util-linux.git] / libfdisk / src / script.c
index e73c8dcdb1d2292322a956f50f6b30c3291722fc..cc53c3b7db5ca8cedfe090defcaa3579c127af6e 100644 (file)
@@ -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 */