]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Fix possible segmentation fault.
authorae <ae@FreeBSD.org>
Sat, 3 Oct 2015 03:12:57 +0000 (03:12 +0000)
committerae <ae@FreeBSD.org>
Sat, 3 Oct 2015 03:12:57 +0000 (03:12 +0000)
PR: 203494
MFC after: 1 week

sbin/ipfw/ipfw2.c

index 8ad8f90cc3176c43381ad74b248d8f89036c78aa..bc8af9f833a64b1777cd2bce68eddb686fa30b0b 100644 (file)
@@ -3625,7 +3625,7 @@ compile_rule(char *av[], uint32_t *rbuf, int *rbufsize, struct tidx *tstate)
                action->opcode = O_NAT;
                action->len = F_INSN_SIZE(ipfw_insn_nat);
                CHECK_ACTLEN;
-               if (_substrcmp(*av, "global") == 0) {
+               if (*av != NULL && _substrcmp(*av, "global") == 0) {
                        action->arg1 = 0;
                        av++;
                        break;