From bd24e861b4ef7cafe2bd00963cdb3ac69198aceb Mon Sep 17 00:00:00 2001 From: Eugene Grosbein Date: Thu, 17 Jan 2019 14:09:55 +0000 Subject: [PATCH] jail(8): stop crashing with SIGSEGV inside run_command() function while processing not entirely correct jail.conf(5) file having something like "ip4.addr = 127.0.0.1;" and no "ip4 = ...;" so extrap variable stays NULL. Reported by: marck MFC after: 1 month --- 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 53f4f80862ce..95f2c735dff5 100644 --- a/usr.sbin/jail/command.c +++ b/usr.sbin/jail/command.c @@ -374,7 +374,7 @@ run_command(struct cfjail *j) argc = 4; } - if (!down) { + if (!down && extrap != NULL) { for (cs = strtok(extrap, " "); cs; cs = strtok(NULL, " ")) { size_t len = strlen(cs) + 1;