aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/cosine.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2011-04-07 23:16:05 +0000
committerGerald Combs <gerald@wireshark.org>2011-04-07 23:16:05 +0000
commit56bc7f5e47bdb0254e647aee9a5d6ba79787a934 (patch)
tree9ec277c86ad62277a207ea0af1f7dbe0f79e3853 /wiretap/cosine.c
parentd00527f3690b6ca2b685d77538b1ff6c7d645da9 (diff)
Be more picky about our sscanf integer field widths. Hopefully this will
help squelch Coverity CIDs 701-709. svn path=/trunk/; revision=36511
Diffstat (limited to 'wiretap/cosine.c')
-rw-r--r--wiretap/cosine.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wiretap/cosine.c b/wiretap/cosine.c
index 83cd8cc025..42e11d384d 100644
--- a/wiretap/cosine.c
+++ b/wiretap/cosine.c
@@ -380,11 +380,11 @@ parse_cosine_rec_hdr(wtap *wth, const char *line,
char if_name[COSINE_MAX_IF_NAME_LEN] = "", direction[6] = "";
struct tm tm;
- if (sscanf(line, "%d-%d-%d,%d:%d:%d.%d:",
+ if (sscanf(line, "%4d-%2d-%2d,%2d:%2d:%2d.%9d:",
&yy, &mm, &dd, &hr, &min, &sec, &csec) == 7) {
/* appears to be output to a control blade */
num_items_scanned = sscanf(line,
- "%d-%d-%d,%d:%d:%d.%d: %5s (%127[A-Za-z0-9/:]), Length:%d, Pro:%d, Off:%d, Pri:%d, RM:%d, Err:%d [%x, %x]",
+ "%4d-%2d-%2d,%2d:%2d:%2d.%9d: %5s (%127[A-Za-z0-9/:]), Length:%9d, Pro:%9d, Off:%9d, Pri:%9d, RM:%9d, Err:%9d [%8x, %8x]",
&yy, &mm, &dd, &hr, &min, &sec, &csec,
direction, if_name, &pkt_len,
&pro, &off, &pri, &rm, &error,
@@ -398,7 +398,7 @@ parse_cosine_rec_hdr(wtap *wth, const char *line,
} else {
/* appears to be output to PE */
num_items_scanned = sscanf(line,
- "%5s (%127[A-Za-z0-9/:]), Length:%d, Pro:%d, Off:%d, Pri:%d, RM:%d, Err:%d [%x, %x]",
+ "%5s (%127[A-Za-z0-9/:]), Length:%9d, Pro:%9d, Off:%9d, Pri:%9d, RM:%9d, Err:%9d [%8x, %8x]",
direction, if_name, &pkt_len,
&pro, &off, &pri, &rm, &error,
&code1, &code2);