Skip to content

Commit 2595c90

Browse files
authored
Merge pull request appneta#532 from appneta/Bug_#520_2_heap-buffer-overflow_problems
Bug appneta#520 Fix heap overflow on zero or 0xFFFF packet length
2 parents 0fc5a8f + 6b830a1 commit 2595c90

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dnl $Id$
44
AC_PREREQ([2.69])
55

66
dnl Set version info here!
7-
AC_INIT([tcpreplay],[4.3.0],
7+
AC_INIT([tcpreplay],[4.3.1],
88
[https://github.com/appneta/tcpreplay/issues],
99
[tcpreplay],
1010
[http://tcpreplay.sourceforge.net/])

docs/CHANGELOG

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
12/27/2018 Version 4.3.1
2+
- Fix checkspell detected typos (#531)
3+
- Heap overflow packet2tree and get_l2len (#530)
4+
15
11/10/2018 Version 4.3.0
26
- Fix maxOS TOS checksum failure (#524)
37
- TCP sequence edits seeding (#514)

src/common/utils.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ u_char *_our_safe_pcap_next(pcap_t *pcap, struct pcap_pkthdr *pkthdr,
134134
exit(-1);
135135
}
136136

137-
if (pkthdr->len < pkthdr->caplen) {
138-
fprintf(stderr, "safe_pcap_next ERROR: Invalid packet length in %s:%s() line %d: packet length %u is less than capture length %u\n",
137+
if (!pkthdr->len || pkthdr->len < pkthdr->caplen) {
138+
fprintf(stderr, "safe_pcap_next ERROR: Invalid packet length in %s:%s() line %d: packet length=%u capture length=%u\n",
139139
file, funcname, line, pkthdr->len, pkthdr->caplen);
140140
exit(-1);
141141
}
@@ -160,8 +160,8 @@ int _our_safe_pcap_next_ex(pcap_t *pcap, struct pcap_pkthdr **pkthdr,
160160
exit(-1);
161161
}
162162

163-
if ((*pkthdr)->len < (*pkthdr)->caplen) {
164-
fprintf(stderr, "safe_pcap_next_ex ERROR: Invalid packet length in %s:%s() line %d: packet length %u is less than capture length %u\n",
163+
if (!(*pkthdr)->len || (*pkthdr)->len < (*pkthdr)->caplen) {
164+
fprintf(stderr, "safe_pcap_next_ex ERROR: Invalid packet length in %s:%s() line %d: packet length=%u capture length=%u\n",
165165
file, funcname, line, (*pkthdr)->len, (*pkthdr)->caplen);
166166
exit(-1);
167167
}

0 commit comments

Comments
 (0)