aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>1999-11-11 19:19:17 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>1999-11-11 19:19:17 +0000
commit56b9fc48618f6dca51cd45d447ab6f1c2c4031fb (patch)
treef3e4bd047f9063654c1d5786e671a8ecb9342c95 /wiretap
parent6043b610ed2bce00a511a70f441da68dab5a17b7 (diff)
Remove potential for a bad toshiba trace file to overflow a fixed char[]
buffer in sscanf call. svn path=/trunk/; revision=1012
Diffstat (limited to 'wiretap')
-rw-r--r--wiretap/toshiba.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/wiretap/toshiba.c b/wiretap/toshiba.c
index 76e0b1d07d..9fa28847ef 100644
--- a/wiretap/toshiba.c
+++ b/wiretap/toshiba.c
@@ -1,6 +1,6 @@
/* toshiba.c
*
- * $Id: toshiba.c,v 1.3 1999/11/11 06:29:59 gram Exp $
+ * $Id: toshiba.c,v 1.4 1999/11/11 19:19:17 gram Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@@ -271,8 +271,10 @@ parse_toshiba_rec_hdr(wtap *wth, FILE *fh, int *err)
return -1;
}
- /* Find text in line after "[No." */
- num_items_scanned = sscanf(line, "%d] %d:%d:%d.%d %s %s",
+ /* Find text in line after "[No.". Limit the length of the
+ * two strings since we have fixed buffers for channel[] and
+ * direction[] */
+ num_items_scanned = sscanf(line, "%d] %d:%d:%d.%d %9s %9s",
&pktnum, &hr, &min, &sec, &csec, channel, direction);
if (num_items_scanned != 7) {