From: Gene Cumm <gene.cumm at gmail.com> linux/syslinux.c: Test if opt.directory is null before testing first character. Signed-off-by: Gene Cumm <gene.cumm at gmail.com> --- diff --git a/linux/syslinux.c b/linux/syslinux.c index 3a51f7e..2fd562e 100644 --- a/linux/syslinux.c +++ b/linux/syslinux.c @@ -283,7 +283,8 @@ int main(int argc, char *argv[]) parse_options(argc, argv, MODE_SYSLINUX); ret = asprintf(&subdir, "%s%s", - opt.directory[0] == '/' ? "" : "/", opt.directory); + (opt.directory ? ((opt.directory[0] == '/') ? "" : "/") : ""), + opt.directory); if (!subdir) { perror(program); exit(1);
Replaces previous patch. From: Gene Cumm <gene.cumm at gmail.com> linux/syslinux.c: Test if opt.directory is null before testing first character or attempting to use it. Signed-off-by: Gene Cumm <gene.cumm at gmail.com> asprintf was converting a NULL opt.directory to the string "(null)". --- diff --git a/linux/syslinux.c b/linux/syslinux.c index 3a51f7e..8db9cdd 100644 --- a/linux/syslinux.c +++ b/linux/syslinux.c @@ -283,7 +283,8 @@ int main(int argc, char *argv[]) parse_options(argc, argv, MODE_SYSLINUX); ret = asprintf(&subdir, "%s%s", - opt.directory[0] == '/' ? "" : "/", opt.directory); + (opt.directory ? ((opt.directory[0] == '/') ? "" : "/") : ""), + (opt.directory ? opt.directory : "")); if (!subdir) { perror(program); exit(1);