]> The Tcpdump Group git mirrors - libpcap/commitdiff
Handle *all* protocol qualifiers in gen_host() - even link/tr/etc.
authorGuy Harris <[email protected]>
Mon, 22 Oct 2018 08:23:45 +0000 (01:23 -0700)
committerGuy Harris <[email protected]>
Mon, 22 Oct 2018 08:23:45 +0000 (01:23 -0700)
We missed that one.

Credit to OSS-Fuzz for finding this issue.

gencode.c

index 536c73d258856f9c83accbf095e4b230541046d1..33d81d825f276ede1b6665b5c5f580f1c6c16d5b 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -4814,6 +4814,9 @@ gen_host(compiler_state_t *cstate, bpf_u_int32 addr, bpf_u_int32 mask,
                }
                return b0;
 
+       case Q_LINK:
+               bpf_error(cstate, "link-layer modifier applied to %s", typestr);
+
        case Q_IP:
                return gen_hostop(cstate, addr, mask, dir, ETHERTYPE_IP, 12, 16);