summaryrefslogtreecommitdiffstats
path: root/usr.bin/m4
diff options
context:
space:
mode:
authorjmallett <jmallett@FreeBSD.org>2002-09-04 01:12:39 +0000
committerjmallett <jmallett@FreeBSD.org>2002-09-04 01:12:39 +0000
commiteadd2de4a6e46f2d7ebf9a6d45e19ebc83fd30dd (patch)
treeec4e756c34467802fbda666d281cd2efc502a707 /usr.bin/m4
parentde510133e2a54da90e8cf63156a9296f82c3f6a2 (diff)
downloadFreeBSD-src-eadd2de4a6e46f2d7ebf9a6d45e19ebc83fd30dd.zip
FreeBSD-src-eadd2de4a6e46f2d7ebf9a6d45e19ebc83fd30dd.tar.gz
Die on -D=foo, when parsing options - we can't let someone define (nil).
MFC after: 3 days
Diffstat (limited to 'usr.bin/m4')
-rw-r--r--usr.bin/m4/main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c
index 722fc92..a1cf065 100644
--- a/usr.bin/m4/main.c
+++ b/usr.bin/m4/main.c
@@ -204,6 +204,8 @@ main(int argc, char *argv[])
for (p = optarg; *p; p++)
if (*p == '=')
break;
+ if (p == optarg)
+ errx(1, "null variable cannot be defined");
if (*p)
*p++ = EOS;
dodefine(optarg, p);
OpenPOWER on IntegriCloud