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:
eugen 2019-01-17 14:09:55 +00:00
parent 72a21ba0f6
commit b5e24ffa8c

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;