diff options
author | Gerald Combs <gerald@wireshark.org> | 2018-02-05 14:28:10 -0800 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2018-02-06 18:15:18 +0000 |
commit | 7e76e5f2c865fa868b551fb974f71dade1972383 (patch) | |
tree | 0be30978343a6c2bf3fdb813dacd6abae4a08d3e /epan | |
parent | 395016356cca7f9c162ac974c3b889461965a5ba (diff) |
Make sure we pass valid addresses to find_conversation.
Pass empty (AT_NONE) addresses to find_conversation and
conversation_create_endpoint instead of NULL, similar to the LBTxx and
other dissectors.
Bug: 14394
Change-Id: Ia4573b276551a9c3d2da155faf786e8d15229100
Reviewed-on: https://code.wireshark.org/review/25620
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/conversation.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/epan/conversation.c b/epan/conversation.c index aac4adc747..c653166b32 100644 --- a/epan/conversation.c +++ b/epan/conversation.c @@ -78,6 +78,12 @@ static wmem_map_t *conversation_hashtable_no_addr2_or_port2 = NULL; static guint32 new_index; /* + * Placeholder for address-less conversations. + */ +static address null_address_ = ADDRESS_INIT_NONE; + + +/* * Creates a new conversation with known endpoints based on a conversation * created with the CONVERSATION_TEMPLATE option while keeping the * conversation created with the CONVERSATION_TEMPLATE option so it can still @@ -626,9 +632,9 @@ conversation_new(const guint32 setup_frame, const address *addr1, const address conversation_t *conversation=NULL; conversation_key_t new_key; - DPRINT(("creating conversation for frame #%d: %s:%d -> %s:%d (ptype=%d)", + DPRINT(("creating conversation for frame #%d: %s:%d -> %s:%d (etype=%d)", setup_frame, address_to_str(wmem_packet_scope(), addr1), port1, - address_to_str(wmem_packet_scope(), addr2), port2, ptype)); + address_to_str(wmem_packet_scope(), addr2), port2, etype)); if (options & NO_ADDR2) { if (options & (NO_PORT2|NO_PORT2_FORCE)) { @@ -1190,7 +1196,7 @@ find_conversation(const guint32 frame_num, const address *addr_a, const address conversation_t *find_conversation_by_id(const guint32 frame, const endpoint_type etype, const guint32 id, const guint options) { /* Force the lack of a address or port B */ - return find_conversation(frame, NULL, NULL, etype, id, 0, options|NO_ADDR_B|NO_PORT_B); + return find_conversation(frame, &null_address_, &null_address_, etype, id, 0, options|NO_ADDR_B|NO_PORT_B); } void @@ -1393,7 +1399,7 @@ void conversation_create_endpoint_by_id(struct _packet_info *pinfo, endpoint_type etype, guint32 id, const guint options) { /* Force the lack of a address or port B */ - conversation_create_endpoint(pinfo, NULL, NULL, etype, id, 0, options|NO_ADDR_B|NO_PORT_B); + conversation_create_endpoint(pinfo, &null_address_, &null_address_, etype, id, 0, options|NO_ADDR_B|NO_PORT_B); } guint32 conversation_get_endpoint_by_id(struct _packet_info *pinfo, endpoint_type etype, const guint options) |