diff options
author | Laurent Deniel <laurent.deniel@free.fr> | 2000-08-19 18:20:59 +0000 |
---|---|---|
committer | Laurent Deniel <laurent.deniel@free.fr> | 2000-08-19 18:20:59 +0000 |
commit | 8bc95e98e407bbe1f9584c7142814497325eafcc (patch) | |
tree | 4ca56c89fd833e34b9657c5f69cbfd5a2928a355 /capture.c | |
parent | 69dce2464bb89fbcd37230d4aad8c64078dcd2d6 (diff) | |
download | wireshark-8bc95e98e407bbe1f9584c7142814497325eafcc.tar.gz wireshark-8bc95e98e407bbe1f9584c7142814497325eafcc.tar.bz2 wireshark-8bc95e98e407bbe1f9584c7142814497325eafcc.zip |
Fix potential buffer overflows.
svn path=/trunk/; revision=2298
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,7 +1,7 @@ /* capture.c * Routines for packet capture windows * - * $Id: capture.c,v 1.119 2000/08/14 08:36:39 guy Exp $ + * $Id: capture.c,v 1.120 2000/08/19 18:20:56 deniel Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -947,7 +947,7 @@ capture(void) pcap_t *pch; int pcap_encap; int snaplen; - gchar err_str[PCAP_ERRBUF_SIZE], label_str[32]; + gchar err_str[PCAP_ERRBUF_SIZE], label_str[64]; loop_data ld; bpf_u_int32 netnum, netmask; time_t upd_time, cur_time; @@ -1131,11 +1131,13 @@ capture(void) default: if (err < 0) { - sprintf(errmsg, "The file to which the capture would be" + snprintf(errmsg, sizeof(errmsg), + "The file to which the capture would be" " saved (\"%s\") could not be opened: Error %d.", cfile.save_file, err); } else { - sprintf(errmsg, "The file to which the capture would be" + snprintf(errmsg, sizeof(errmsg), + "The file to which the capture would be" " saved (\"%s\") could not be opened: %s.", cfile.save_file, strerror(err)); } |