From 57d9d1d762b2fa2dac5dd11a1e88890e2ec0e7c7 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Mon, 12 Apr 2004 20:05:11 +0000 Subject: [PATCH] The .DEFAULT target with no commands caused a null pointer dereference. PR: bin/63405 Obtained from: NetBSD --- usr.bin/make/suff.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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));