aboutsummaryrefslogtreecommitdiffstats
path: root/epan/packet.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2004-10-31 23:22:14 +0000
committerGuy Harris <guy@alum.mit.edu>2004-10-31 23:22:14 +0000
commite5fe9ec89608026a41e922c9b113ffe241e5b2bb (patch)
tree3bc1dbd1dee027df89bb5e387e2750c9ae16bbaa /epan/packet.c
parentd9995f4eee961bcfe7bbf5fd8c933c6d0d5e2137 (diff)
Make sure we don't return a random value in an unset variable if an
exception is thrown while dissecting an "error packet". svn path=/trunk/; revision=12457
Diffstat (limited to 'epan/packet.c')
-rw-r--r--epan/packet.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/epan/packet.c b/epan/packet.c
index aaf1bf7af1..9c18e8b422 100644
--- a/epan/packet.c
+++ b/epan/packet.c
@@ -496,7 +496,17 @@ call_dissector_work(dissector_handle_t handle, tvbuff_t *tvb,
RETHROW;
}
CATCH(ReportedBoundsError) {
- ; /* do nothing */
+ /*
+ * "ret" wasn't set because an exception was thrown
+ * before "call_dissector_through_handle()" returned.
+ * As it called something, at least one dissector
+ * accepted the packet, and, as an exception was
+ * thrown, not only was all the tvbuff dissected,
+ * a dissector tried dissecting past the end of
+ * the data in some tvbuff, so we'll assume that
+ * the entire tvbuff was dissected.
+ */
+ ret = tvb_length(tvb);
}
ENDTRY;