aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/suff.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2004-04-12 20:05:11 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2004-04-12 20:05:11 +0000
commit57d9d1d762b2fa2dac5dd11a1e88890e2ec0e7c7 (patch)
treee8ff68da99c3035dd0a41164e7054d388f6d0976 /usr.bin/make/suff.c
parentff356053a1d3026ec9e4beaab9f10ce55f9ddf9a (diff)
downloadsrc-57d9d1d762b2fa2dac5dd11a1e88890e2ec0e7c7.tar.gz
src-57d9d1d762b2fa2dac5dd11a1e88890e2ec0e7c7.zip
The .DEFAULT target with no commands caused a null pointer dereference.
PR: bin/63405 Obtained from: NetBSD
Notes
Notes: svn path=/head/; revision=128165
Diffstat (limited to 'usr.bin/make/suff.c')
-rw-r--r--usr.bin/make/suff.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/make/suff.c b/usr.bin/make/suff.c
index b1f68c8ec5a1..bd02152b5bfb 100644
--- a/usr.bin/make/suff.c
+++ b/usr.bin/make/suff.c
@@ -635,7 +635,12 @@ Suff_EndTransform(void *gnp, void *dummy __unused)
{
Suff *s, *t;
- (void)SuffParseTransform(gn->name, &s, &t);
+ /*
+ * SuffParseTransform() may fail for special rules which are not
+ * actual transformation rules (e.g., .DEFAULT).
+ */
+ if (!SuffParseTransform(gn->name, &s, &t))
+ return (0);
DEBUGF(SUFF, ("deleting transformation from `%s' to `%s'\n",
s->name, t->name));