From 084492924798bb0e48eb193e3c095303589810be Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Tue, 30 Apr 2013 23:19:47 +0000 Subject: [PATCH] Follow-up to r49055 as noted on https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7359 The BER integer dissection routines take an hf_id, but that can be -1. Only fetch the type (to check signedness) if hf_id >= 0, as otherwise this causes a dissector bug. Default to signed if given no hf_id - I don't know whether this should be unsigned or not, but the old behaviour was that everything was signed so it's not a regression at least. svn path=/trunk/; revision=49101 --- epan/dissectors/packet-ber.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/packet-ber.c b/epan/dissectors/packet-ber.c index 6ff7ae3314..2d8e67997b 100644 --- a/epan/dissectors/packet-ber.c +++ b/epan/dissectors/packet-ber.c @@ -1712,7 +1712,10 @@ printf("INTEGERnew dissect_ber_integer(%s) entered implicit_tag:%d \n", name, im if (len > 0) { /* extend sign bit for signed fields */ guint8 first = tvb_get_guint8(tvb, offset); - enum ftenum type = proto_registrar_get_ftype(hf_id); + enum ftenum type = FT_INT32; /* Default to signed, is this correct? */ + if (hf_id >= 0) { + type = proto_registrar_get_ftype(hf_id); + } if (first & 0x80 && IS_FT_INT(type)) { val = -1; } -- 2.34.1