CID 5044: Protect against NULL deref.
This commit is contained in:
parent
b86f9ffb61
commit
ca9294c412
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: var.c,v 1.149 2009/01/28 21:38:13 dsl Exp $ */
|
||||
/* $NetBSD: var.c,v 1.150 2009/02/18 20:08:32 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1989, 1990, 1993
|
||||
@ -69,14 +69,14 @@
|
||||
*/
|
||||
|
||||
#ifndef MAKE_NATIVE
|
||||
static char rcsid[] = "$NetBSD: var.c,v 1.149 2009/01/28 21:38:13 dsl Exp $";
|
||||
static char rcsid[] = "$NetBSD: var.c,v 1.150 2009/02/18 20:08:32 christos Exp $";
|
||||
#else
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
|
||||
#else
|
||||
__RCSID("$NetBSD: var.c,v 1.149 2009/01/28 21:38:13 dsl Exp $");
|
||||
__RCSID("$NetBSD: var.c,v 1.150 2009/02/18 20:08:32 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
#endif
|
||||
@ -793,7 +793,8 @@ Var_Set(const char *name, const char *val, GNode *ctxt, int flags)
|
||||
/* we just added it */
|
||||
v = VarFind(name, ctxt, 0);
|
||||
}
|
||||
v->flags |= VAR_FROM_CMD;
|
||||
if (v != (Var *)NIL)
|
||||
v->flags |= VAR_FROM_CMD;
|
||||
/*
|
||||
* If requested, don't export these in the environment
|
||||
* individually. We still put them in MAKEOVERRIDES so
|
||||
|
Loading…
Reference in New Issue
Block a user