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
This commit is contained in:
Eugene Grosbein 2019-01-17 14:09:55 +00:00
parent 88640c0e8b
commit bd24e861b4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343112

View File

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