aboutsummaryrefslogtreecommitdiffstats
path: root/epan/proto.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-05-26 14:53:39 +0000
committerGerald Combs <gerald@wireshark.org>2005-05-26 14:53:39 +0000
commit4a5deae5759f85eba4592689aec83ce380959af6 (patch)
treec4a632aa2d7f9bef67629cb4194a84a7a675b0ca /epan/proto.c
parent351214282dba3126faea8ccab2e3310f4ce35cf7 (diff)
downloadwireshark-4a5deae5759f85eba4592689aec83ce380959af6.tar.gz
wireshark-4a5deae5759f85eba4592689aec83ce380959af6.tar.bz2
wireshark-4a5deae5759f85eba4592689aec83ce380959af6.zip
In some places we call proto_tree_add_item() with hfindex and length
values that may not be valid (e.g. dissect_ber_octet_string() in packet-ber.c). If the length is invalid, get_uint_value() or get_int_value() will abort. Change them to throw an exception instead. This keeps us from having to do a lot of extra work in the dissector. Fixes bug 182. svn path=/trunk/; revision=14437
Diffstat (limited to 'epan/proto.c')
-rw-r--r--epan/proto.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/proto.c b/epan/proto.c
index 9a8882a3e1..f6b681de13 100644
--- a/epan/proto.c
+++ b/epan/proto.c
@@ -677,7 +677,7 @@ get_uint_value(tvbuff_t *tvb, gint offset, gint length, gboolean little_endian)
break;
default:
- DISSECTOR_ASSERT_NOT_REACHED();
+ THROW(ReportedBoundsError);
value = 0;
break;
}
@@ -715,7 +715,7 @@ get_int_value(tvbuff_t *tvb, gint offset, gint length, gboolean little_endian)
break;
default:
- DISSECTOR_ASSERT_NOT_REACHED();
+ THROW(ReportedBoundsError);
value = 0;
break;
}