aboutsummaryrefslogtreecommitdiffstats
path: root/capture.c
diff options
context:
space:
mode:
authorLaurent Deniel <laurent.deniel@free.fr>2000-08-19 18:20:59 +0000
committerLaurent Deniel <laurent.deniel@free.fr>2000-08-19 18:20:59 +0000
commit8bc95e98e407bbe1f9584c7142814497325eafcc (patch)
tree4ca56c89fd833e34b9657c5f69cbfd5a2928a355 /capture.c
parent69dce2464bb89fbcd37230d4aad8c64078dcd2d6 (diff)
downloadwireshark-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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/capture.c b/capture.c
index dc8beb7b9c..9edc988da1 100644
--- a/capture.c
+++ b/capture.c
@@ -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));
}