From cf8736c474a370578457c7485d55e15583741d33 Mon Sep 17 00:00:00 2001 From: jamie Date: Thu, 17 Dec 2009 05:06:56 +0000 Subject: [PATCH] Add a null pointer check so "name" can be used as a key parameter in jailparam_get. PR: bin/141692 Submitted by: delphij MFC after: 3 days --- lib/libjail/jail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libjail/jail.c b/lib/libjail/jail.c index 9411b88bdf6b..39c88d098edc 100644 --- a/lib/libjail/jail.c +++ b/lib/libjail/jail.c @@ -532,7 +532,7 @@ jailparam_get(struct jailparam *jp, unsigned njp, int flags) } jp_key = jp_lastjid ? jp_lastjid : jp_jid && jp_jid->jp_valuelen == sizeof(int) && - *(int *)jp_jid->jp_value ? jp_jid : jp_name; + jp_jid->jp_value && *(int *)jp_jid->jp_value ? jp_jid : jp_name; if (jp_key == NULL || jp_key->jp_value == NULL) { strlcpy(jail_errmsg, "no jail specified", JAIL_ERRMSGLEN); errno = ENOENT;