Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Jan 2019 14:09:56 +0000 (UTC)
From:      Eugene Grosbein <eugen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343112 - head/usr.sbin/jail
Message-ID:  <201901171409.x0HE9ubv040665@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: eugen
Date: Thu Jan 17 14:09:55 2019
New Revision: 343112
URL: https://svnweb.freebsd.org/changeset/base/343112

Log:
  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

Modified:
  head/usr.sbin/jail/command.c

Modified: head/usr.sbin/jail/command.c
==============================================================================
--- head/usr.sbin/jail/command.c	Thu Jan 17 06:35:45 2019	(r343111)
+++ head/usr.sbin/jail/command.c	Thu Jan 17 14:09:55 2019	(r343112)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201901171409.x0HE9ubv040665>