diff --git a/sys/kern/kern_jail.c b/sys/kern/kern_jail.c index a1734e1..b42a172 100644 --- a/sys/kern/kern_jail.c +++ b/sys/kern/kern_jail.c @@ -953,8 +953,9 @@ kern_jail_set(struct thread *td, struct uio *optuio, int flags) VOP_UNLOCK(root, 0); if (fullpath_disabled) { /* Leave room for a real-root full pathname. */ - if (len + (path[0] == '/' && strcmp(mypr->pr_path, "/") - ? strlen(mypr->pr_path) : 0) > MAXPATHLEN) { + if (len + (path != NULL && path[0] == '/' && + strcmp(mypr->pr_path, "/") ? + strlen(mypr->pr_path) : 0) > MAXPATHLEN) { error = ENAMETOOLONG; vrele(root); goto done_free;