summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wiretap/catapult_dct2000.c2
-rw-r--r--wiretap/cosine.c2
-rw-r--r--wiretap/dbs-etherwatch.c2
-rw-r--r--wiretap/file_access.c4
-rw-r--r--wiretap/iseries.c2
-rw-r--r--wiretap/netscaler.c3
-rw-r--r--wiretap/ngsniffer.c4
-rw-r--r--wiretap/pppdump.c2
-rw-r--r--wiretap/vms.c2
9 files changed, 13 insertions, 10 deletions
diff --git a/wiretap/catapult_dct2000.c b/wiretap/catapult_dct2000.c
index fec3f5a22f..eaf5cb3862 100644
--- a/wiretap/catapult_dct2000.c
+++ b/wiretap/catapult_dct2000.c
@@ -360,7 +360,7 @@ gboolean catapult_dct2000_read(wtap *wth, int *err, gchar **err_info _U_,
strlen(protocol_name)+1 + /* Protocol name */
1 + /* direction */
1 + /* encap */
- is_comment ? data_chars : (data_chars/2));
+ (is_comment ? data_chars : (data_chars/2)));
frame_buffer = buffer_start_ptr(wth->frame_buffer);
diff --git a/wiretap/cosine.c b/wiretap/cosine.c
index 3f8fafedb4..83cd8cc025 100644
--- a/wiretap/cosine.c
+++ b/wiretap/cosine.c
@@ -377,7 +377,7 @@ parse_cosine_rec_hdr(wtap *wth, const char *line,
int yy, mm, dd, hr, min, sec, csec, pkt_len;
int pro, off, pri, rm, error;
guint code1, code2;
- char if_name[COSINE_MAX_IF_NAME_LEN], direction[6];
+ char if_name[COSINE_MAX_IF_NAME_LEN] = "", direction[6] = "";
struct tm tm;
if (sscanf(line, "%d-%d-%d,%d:%d:%d.%d:",
diff --git a/wiretap/dbs-etherwatch.c b/wiretap/dbs-etherwatch.c
index 38305fd3d6..d4d40537dd 100644
--- a/wiretap/dbs-etherwatch.c
+++ b/wiretap/dbs-etherwatch.c
@@ -325,7 +325,7 @@ parse_dbs_etherwatch_packet(wtap *wth, FILE_T fh, guint8* buf, int *err,
int eth_hdr_len, pkt_len, csec;
int length_pos, length_from, length;
struct tm tm;
- char mon[4];
+ char mon[4] = "xxx";
gchar *p;
static const gchar months[] = "JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
int count, line_count;
diff --git a/wiretap/file_access.c b/wiretap/file_access.c
index a5e3254285..d3c271f358 100644
--- a/wiretap/file_access.c
+++ b/wiretap/file_access.c
@@ -785,7 +785,7 @@ wtap_dumper* wtap_dump_open(const char *filename, int filetype, int encap,
return NULL; /* compress won't work on stdout */
}
#ifdef _WIN32
- setmode(fileno(stdout), O_BINARY);
+ _setmode(fileno(stdout), O_BINARY);
#endif
wdh->fh = stdout;
} else {
@@ -832,7 +832,7 @@ wtap_dumper* wtap_dump_fdopen(int fd, int filetype, int encap, int snaplen,
#ifdef _WIN32
if(fd == 1) {
- setmode(fileno(stdout), O_BINARY);
+ _setmode(fileno(stdout), O_BINARY);
}
#endif
diff --git a/wiretap/iseries.c b/wiretap/iseries.c
index 91418ca48f..2d83745559 100644
--- a/wiretap/iseries.c
+++ b/wiretap/iseries.c
@@ -263,7 +263,7 @@ iseries_check_file_type (wtap * wth, int *err, int format)
{
guint line;
int num_items_scanned;
- char buf[ISERIES_LINE_LENGTH], protocol[9], tcpformat[2];
+ char buf[ISERIES_LINE_LENGTH], protocol[9], tcpformat[2] = "";
iseries_t *iseries;
/* Save trace format for passing between packets */
diff --git a/wiretap/netscaler.c b/wiretap/netscaler.c
index f3e756f4ad..1fe05b0082 100644
--- a/wiretap/netscaler.c
+++ b/wiretap/netscaler.c
@@ -1091,7 +1091,8 @@ static gboolean nstrace_add_signature(wtap_dumper *wdh, int *err)
/* populate the record */
sig10.phd.ph_RecordType = htoles(NSPR_SIGNATURE_V10);
sig10.phd.ph_RecordSize = htoles(nspr_signature_v10_s);
- memcpy(sig10.sig_Signature, NSPR_SIGSTR_V10, NSPR_SIGSIZE_V10);
+ memset(sig10.sig_Signature, 0, NSPR_SIGSIZE_V10);
+ strcpy(sig10.sig_Signature, NSPR_SIGSTR_V10);
/* Write the record into the file */
if (!wtap_dump_file_write(wdh, &sig10, nspr_signature_v10_s,
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c
index 74978ae4a4..cd9698f0ee 100644
--- a/wiretap/ngsniffer.c
+++ b/wiretap/ngsniffer.c
@@ -1200,7 +1200,7 @@ found:
/*
* 40-bit time stamp, in units of timeunit picoseconds.
*/
- t = (((guint64)time_high)<<32) | (((guint32)time_med) << 16) | time_low;
+ t = (((guint64)time_high)<<32) | (((guint64)time_med) << 16) | time_low;
/*
* timeunit is always < 2^(64-40), so t * timeunit fits in 64
@@ -2463,6 +2463,8 @@ ng_file_read(void *buffer, size_t elementsize, size_t numelements, wtap *wth,
if (is_random) {
/* Move to the next blob in the list. */
ngsniffer->current_blob = g_list_next(ngsniffer->current_blob);
+ if (!ngsniffer->current_blob)
+ return -1;
blob = ngsniffer->current_blob->data;
} else {
/* If we also have a random stream open, add a new element,
diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c
index a0d51ebc1e..a0e8d303e2 100644
--- a/wiretap/pppdump.c
+++ b/wiretap/pppdump.c
@@ -514,7 +514,7 @@ process_data(pppdump_t *state, FILE_T fh, pkt_t *pkt, int n, guint8 *pd,
}
pkt->buf[pkt->cnt++] = c;
- if (pkt->cnt > PPPD_BUF_SIZE) {
+ if (pkt->cnt >= PPPD_BUF_SIZE) {
*err = WTAP_ERR_UNC_OVERFLOW;
return -1;
}
diff --git a/wiretap/vms.c b/wiretap/vms.c
index efc1f9eba6..92c3ae08b0 100644
--- a/wiretap/vms.c
+++ b/wiretap/vms.c
@@ -392,7 +392,7 @@ parse_vms_rec_hdr(wtap *wth, FILE_T fh, int *err, gchar **err_info)
}
line[VMS_LINE_LENGTH] = '\0';
- if ((csec == 101) && (p = strstr(line, "packet "))
+ if ((csec == 101) && (p = strstr(line, "packet ")) != NULL
&& (! strstr(line, "could not save "))) {
/* Find text in line starting with "packet ". */