git: 561dcc7f3722 - stable/12 - jail: fix a NULL pointer derefence in parsing ip6.addr settings.

From: Jamie Gritton <jamie_at_FreeBSD.org>
Date: Sun, 18 Dec 2022 00:33:37 UTC
The branch stable/12 has been updated by jamie:

URL: https://cgit.FreeBSD.org/src/commit/?id=561dcc7f3722315c55176be5611a010155724a89

commit 561dcc7f3722315c55176be5611a010155724a89
Author:     Jamie Gritton <jamie@FreeBSD.org>
AuthorDate: 2022-12-15 00:47:55 +0000
Commit:     Jamie Gritton <jamie@FreeBSD.org>
CommitDate: 2022-12-18 00:33:04 +0000

    jail: fix a NULL pointer derefence in parsing ip6.addr settings.
    
    This is the counterpart to bd24e861b4ef, which did the same for ip4.
    PR:             268377
    Reported by:    ahkithaama at proton.me
    
    (cherry picked from commit e8d7ae918a105f252cf06249787d82f43e023ba8)
---
 usr.sbin/jail/command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/jail/command.c b/usr.sbin/jail/command.c
index 8061b9a21878..56612718a879 100644
--- a/usr.sbin/jail/command.c
+++ b/usr.sbin/jail/command.c
@@ -424,7 +424,7 @@ run_command(struct cfjail *j)
 		} else
 			argc = 4;
 
-		if (!down) {
+		if (!down && extrap != NULL) {
 			for (cs = strtok(extrap, " "); cs;
 			     cs = strtok(NULL, " ")) {
 				size_t len = strlen(cs) + 1;