diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2017-01-29 10:04:14 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2017-01-29 10:04:14 +0000 |
commit | cc8885deebcd7bd625ecc8778ba696ab1bfc47f1 (patch) | |
tree | c0afab95d93f1ae6386462f763e64d6408f4713f /usr.bin | |
parent | 54fb9612f99081a374fda63d0cc948d358743c45 (diff) |
obvious protection against null pointer, because it's quite possible for cgn
to not have a parent...
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/engine.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/make/engine.c b/usr.bin/make/engine.c index 688d26ecb32..f6684cfa4ef 100644 --- a/usr.bin/make/engine.c +++ b/usr.bin/make/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.51 2016/10/21 16:12:38 espie Exp $ */ +/* $OpenBSD: engine.c,v 1.52 2017/01/29 10:04:13 espie Exp $ */ /* * Copyright (c) 2012 Marc Espie. * @@ -300,6 +300,10 @@ Make_HandleUse(GNode *cgn, /* The .USE node */ assert(cgn->type & (OP_USE|OP_TRANSFORM)); + if (pgn == NULL) + Fatal("Trying to apply .USE to '%s' without a parent", + cgn->name); + if ((cgn->type & OP_USE) || Lst_IsEmpty(&pgn->commands)) { /* .USE or transformation and target has no commands * -- append the child's commands to the parent. */ |