diff options
Diffstat (limited to 'text2pcap.c')
-rw-r--r-- | text2pcap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/text2pcap.c b/text2pcap.c index e8d1252f20..c0d557f346 100644 --- a/text2pcap.c +++ b/text2pcap.c @@ -704,12 +704,12 @@ append_to_preamble(char *str) if (toklen != 0) { if (packet_preamble_len + toklen > PACKET_PREAMBLE_MAX_LEN) return; /* no room to add the token to the preamble */ - strcpy(&packet_preamble[packet_preamble_len], str); + strncpy(&packet_preamble[packet_preamble_len], str, PACKET_PREAMBLE_MAX_LEN - packet_preamble_len); packet_preamble_len += toklen; if (debug >= 2) { char *c; char xs[PACKET_PREAMBLE_MAX_LEN]; - strcpy(xs, packet_preamble); + strncpy(xs, packet_preamble, PACKET_PREAMBLE_MAX_LEN); while ((c = strchr(xs, '\r')) != NULL) *c=' '; fprintf (stderr, "[[append_to_preamble: \"%s\"]]", xs); } |