Fix potential buffer overflows.
svn path=/trunk/; revision=2298
This commit is contained in:
parent
69dce2464b
commit
8bc95e98e4
10
capture.c
10
capture.c
@ -1,7 +1,7 @@
|
|||||||
/* capture.c
|
/* capture.c
|
||||||
* Routines for packet capture windows
|
* 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
|
* Ethereal - Network traffic analyzer
|
||||||
* By Gerald Combs <gerald@zing.org>
|
* By Gerald Combs <gerald@zing.org>
|
||||||
@ -947,7 +947,7 @@ capture(void)
|
|||||||
pcap_t *pch;
|
pcap_t *pch;
|
||||||
int pcap_encap;
|
int pcap_encap;
|
||||||
int snaplen;
|
int snaplen;
|
||||||
gchar err_str[PCAP_ERRBUF_SIZE], label_str[32];
|
gchar err_str[PCAP_ERRBUF_SIZE], label_str[64];
|
||||||
loop_data ld;
|
loop_data ld;
|
||||||
bpf_u_int32 netnum, netmask;
|
bpf_u_int32 netnum, netmask;
|
||||||
time_t upd_time, cur_time;
|
time_t upd_time, cur_time;
|
||||||
@ -1131,11 +1131,13 @@ capture(void)
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (err < 0) {
|
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.",
|
" saved (\"%s\") could not be opened: Error %d.",
|
||||||
cfile.save_file, err);
|
cfile.save_file, err);
|
||||||
} else {
|
} 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.",
|
" saved (\"%s\") could not be opened: %s.",
|
||||||
cfile.save_file, strerror(err));
|
cfile.save_file, strerror(err));
|
||||||
}
|
}
|
||||||
|
5
file.c
5
file.c
@ -1,7 +1,7 @@
|
|||||||
/* file.c
|
/* file.c
|
||||||
* File I/O routines
|
* File I/O routines
|
||||||
*
|
*
|
||||||
* $Id: file.c,v 1.206 2000/08/15 21:03:16 deniel Exp $
|
* $Id: file.c,v 1.207 2000/08/19 18:20:58 deniel Exp $
|
||||||
*
|
*
|
||||||
* Ethereal - Network traffic analyzer
|
* Ethereal - Network traffic analyzer
|
||||||
* By Gerald Combs <gerald@zing.org>
|
* By Gerald Combs <gerald@zing.org>
|
||||||
@ -412,7 +412,8 @@ read_cap_file(capture_file *cf, int *err)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sprintf(errmsg_errno, "An error occurred while reading the"
|
snprintf(errmsg_errno, sizeof(errmsg_errno),
|
||||||
|
"An error occurred while reading the"
|
||||||
" capture file: %s.", wtap_strerror(*err));
|
" capture file: %s.", wtap_strerror(*err));
|
||||||
errmsg = errmsg_errno;
|
errmsg = errmsg_errno;
|
||||||
break;
|
break;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/* tethereal.c
|
/* tethereal.c
|
||||||
*
|
*
|
||||||
* $Id: tethereal.c,v 1.41 2000/08/14 08:36:41 guy Exp $
|
* $Id: tethereal.c,v 1.42 2000/08/19 18:20:59 deniel Exp $
|
||||||
*
|
*
|
||||||
* Ethereal - Network traffic analyzer
|
* Ethereal - Network traffic analyzer
|
||||||
* By Gerald Combs <gerald@zing.org>
|
* By Gerald Combs <gerald@zing.org>
|
||||||
@ -1038,7 +1038,8 @@ file_open_error_message(int err, gboolean for_writing)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sprintf(errmsg_errno, "The file \"%%s\" could not be opened: %s.",
|
snprintf(errmsg_errno, sizeof(errmsg_errno),
|
||||||
|
"The file \"%%s\" could not be opened: %s.",
|
||||||
wtap_strerror(err));
|
wtap_strerror(err));
|
||||||
errmsg = errmsg_errno;
|
errmsg = errmsg_errno;
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user