diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-03 15:38:20 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2008-02-03 15:38:20 +0000 |
commit | 47d744b59da83744623bea39c006eb7e2ec02de9 (patch) | |
tree | 17d9ec1526a37c793ee3d7cbd031091d1867dd7f /text2pcap.c | |
parent | e59b5d6b8a963263b0c2dcf163e07b4318737d71 (diff) | |
download | wireshark-47d744b59da83744623bea39c006eb7e2ec02de9.tar.gz |
More rewrite of prohibited APIs (sprintf, strcpy, strcat).
svn path=/trunk/; revision=24258
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); } |