aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-01-14 06:13:07 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-01-14 06:13:07 +0000
commite648b5c77b605477db17e93d78ffd39bee411559 (patch)
treede6abaea1bc0d21f55d1b0b2244f78b3f38c1840 /wiretap
parent76bd9d18a7383906edde89544054616083994c70 (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')
-rw-r--r--wiretap/ascend.c10
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);