summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/tcpdump/print-null.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/tcpdump/print-null.c b/usr.sbin/tcpdump/print-null.c
index a42b3599a86..f90f5e9030c 100644
--- a/usr.sbin/tcpdump/print-null.c
+++ b/usr.sbin/tcpdump/print-null.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: print-null.c,v 1.23 2018/10/22 16:12:45 kn Exp $ */
+/* $OpenBSD: print-null.c,v 1.24 2020/07/21 01:09:03 kn Exp $ */
/*
* Copyright (c) 1991, 1993, 1994, 1995, 1996, 1997
@@ -119,6 +119,11 @@ null_if_print(u_char *user, const struct pcap_pkthdr *h, const u_char *p)
ts_print(&h->ts);
+ if (caplen < NULL_HDRLEN) {
+ printf("[|null]");
+ goto out;
+ }
+
/*
* Some printers want to get back at the link level addresses,
* and/or check that they're not walking off the end of the packet.