diff options
| author | Gaël PORTAY <gael.portay@collabora.com> | 2020-03-20 16:10:35 -0400 |
|---|---|---|
| committer | Gaël PORTAY <gael.portay@collabora.com> | 2020-03-20 16:28:33 -0400 |
| commit | 3468dda9c34b1860d4b64f590651aab718b0cc5e (patch) | |
| tree | 2d2acea333f16c60fa1453efec12729154b06f54 /libfdisk/src/script.c | |
| parent | f205a073633cc2f72662777c5feb302f2f53b60b (diff) | |
| download | util-linux-3468dda9c34b1860d4b64f590651aab718b0cc5e.tar.gz | |
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>
Diffstat (limited to 'libfdisk/src/script.c')
| -rw-r--r-- | libfdisk/src/script.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libfdisk/src/script.c b/libfdisk/src/script.c index e73c8dcdb1..cc53c3b7db 100644 --- a/libfdisk/src/script.c +++ b/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 */ |
