diff --git a/tests/TESTLIST b/tests/TESTLIST index dfb32c9ad..8f96da9f0 100644 --- a/tests/TESTLIST +++ b/tests/TESTLIST @@ -440,6 +440,7 @@ isoclns-heapoverflow-2 isoclns-heapoverflow-2.pcap isoclns-heapoverflow-2.out -e isoclns-heapoverflow-3 isoclns-heapoverflow-3.pcap isoclns-heapoverflow-3.out -e -c1 stp-v4-length-sigsegv stp-v4-length-sigsegv.pcap stp-v4-length-sigsegv.out hoobr_pimv1 hoobr_pimv1.pcap hoobr_pimv1.out +hoobr_safeputs hoobr_safeputs.pcap hoobr_safeputs.out # RTP tests # fuzzed pcap diff --git a/tests/hoobr_safeputs.out b/tests/hoobr_safeputs.out new file mode 100644 index 000000000..fdef40b17 --- /dev/null +++ b/tests/hoobr_safeputs.out @@ -0,0 +1,2 @@ +LLDP, length 808464418: 0000000000 + [|LLDP] diff --git a/tests/hoobr_safeputs.pcap b/tests/hoobr_safeputs.pcap new file mode 100644 index 000000000..ce3b12491 Binary files /dev/null and b/tests/hoobr_safeputs.pcap differ diff --git a/util-print.c b/util-print.c index 394e7d598..ec3e8de86 100644 --- a/util-print.c +++ b/util-print.c @@ -904,7 +904,7 @@ safeputs(netdissect_options *ndo, { u_int idx = 0; - while (*s && idx < maxlen) { + while (idx < maxlen && *s) { safeputchar(ndo, *s); idx++; s++;