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
This commit is contained in:
jamie 2009-12-17 05:06:56 +00:00
parent c0a38f802d
commit cf8736c474

View File

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