diff options
-rw-r--r-- | text2pcap.c | 3 | ||||
-rw-r--r-- | ui/text_import.c | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/text2pcap.c b/text2pcap.c index 7bf8f44854..860e9219d7 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -930,7 +930,8 @@ parse_preamble (void) i++; } packet_preamble_len -= i; - memmove(packet_preamble, packet_preamble+i, packet_preamble_len); + /* Also move the trailing '\0'. */ + memmove(packet_preamble, packet_preamble + i, packet_preamble_len + 1); } diff --git a/ui/text_import.c b/ui/text_import.c index 307b1e1fdc..1afa82d8d8 100644 --- a/ui/text_import.c +++ b/ui/text_import.c @@ -615,7 +615,8 @@ parse_preamble (void) i++; } packet_preamble_len -= i; - memmove(packet_preamble, packet_preamble+i, packet_preamble_len); + /* Also move the trailing '\0'. */ + memmove(packet_preamble, packet_preamble + i, packet_preamble_len + 1); } /* |