Hi, I am working on proprietary RADIUS protocol dissection. I have created 3 sub-dissectors within wireshark which are called from packet-radius.c I want to add one custom display filter in sub-dissector. I am using When I use
In packet-radius.c,
In packet-radius-display.c,
asked 17 Jul ‘17, 07:07 Mehul28 edited 17 Jul ‘17, 22:45 |
2 Answers:
proto_tree_add_uint() may not be used with tvb = NULL and length = 0 from what I can see. answered 18 Jul '17, 02:02 Anders ♦ One can use this, for just developing display filter. There are other packet dissections which have done the same in wireshark. The following code works,
whien I insert it in dissect_radius function of packet-radius.c (18 Jul '17, 02:08) Mehul28 I don't know why it's getting crashed when I use the proto_tree_add_uint API with radius_tree in my sub-dissector? (21 Jul '17, 01:53) Mehul28 What does your debugger say? (21 Jul '17, 02:19) Jaap ♦ Access violation reading location 0xFFFFFFFFFFFFFFFF. (21 Jul '17, 02:42) Mehul28 That looks like a -1 to me, are you absolutely sure that Also, (21 Jul '17, 08:24) grahamb ♦
If you're referring to the line
in So
shouldn't crash with that assertion failure. (21 Jul '17, 21:36) Guy Harris ♦♦ showing 5 of 6 show 1 more comments |
Hi, This is resolved by registering filter variable hf_radius_resp_time using wmem and epan_scope.
Previously, I was registering it statically. Thanks answered 03 Aug '17, 05:05 Mehul28 edited 03 Aug '17, 05:06 @Mehul28, this site has a mechanism of marking questions as usefully answered. If an Answer has usefully answered a Question, the author of the Question (and nobody else) has the possibility to mark it as the correct answer by clicking the checkmark icon next to it. By doing so you change the colour of the Question in the list to green, indicating it as usefully answered to others. There is nothing wrong about marking your own Answer as the correct one. (03 Aug '17, 06:12) sindy
Presumably you mean "allocating filter variable..." - you register it in the Are you modifying (03 Aug '17, 10:51) Guy Harris ♦♦ |
We need to see an abstract of your code to see what’s wrong.
Ok. I have added the code snippet.
Sure it’s not crashing in calc_resp_time() ?
No. calc_resp_time is a function which simply does some arithmetic operation. Wireshark is getting crashed on proto_tree_add_uint call…
So if you know that it’s crashing in
proto_tree_add_uint()
, you have a stack trace showingproto_tree_add_uint()
; what does the stack trace say?