diff options
author | Luis Ontanon <luis.ontanon@gmail.com> | 2007-01-14 06:13:07 +0000 |
---|---|---|
committer | Luis Ontanon <luis.ontanon@gmail.com> | 2007-01-14 06:13:07 +0000 |
commit | e648b5c77b605477db17e93d78ffd39bee411559 (patch) | |
tree | de6abaea1bc0d21f55d1b0b2244f78b3f38c1840 /wiretap/ascend.c | |
parent | 76bd9d18a7383906edde89544054616083994c70 (diff) |
fix Bug 1301
do not let the ascend_open() read more than 256K without finding the first packet.
svn path=/trunk/; revision=20424
Diffstat (limited to 'wiretap/ascend.c')
-rw-r--r-- | wiretap/ascend.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/wiretap/ascend.c b/wiretap/ascend.c index d2a94fd157..be4373b1bc 100644 --- a/wiretap/ascend.c +++ b/wiretap/ascend.c @@ -94,11 +94,17 @@ static gint64 ascend_seek(wtap *wth, int *err) gint64 date_off = -1, cur_off, packet_off; guint string_level[ASCEND_MAGIC_STRINGS]; guint string_i = 0, type = 0; - + guint excessive_read_count = 262144; + memset(&string_level, 0, sizeof(string_level)); while (((byte = file_getc(wth->fh)) != EOF)) { - + excessive_read_count--; + + if (!excessive_read_count) { + return -1; + } + for (string_i = 0; string_i < ASCEND_MAGIC_STRINGS; string_i++) { const gchar *strptr = ascend_magic[string_i].strptr; guint len = strlen(strptr); |