The .DEFAULT target with no commands caused a null pointer dereference.

PR:		bin/63405
Obtained from:	NetBSD
This commit is contained in:
Ruslan Ermilov 2004-04-12 20:05:11 +00:00
parent ff356053a1
commit 57d9d1d762

View File

@ -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));