Blame SOURCES/wireshark-0014-CVE-18226.patch

4a42e1
diff --git a/epan/dissectors/packet-steam-ihs-discovery.c b/epan/dissectors/packet-steam-ihs-discovery.c
4a42e1
index 1bec81e594..9d238f4e88 100644
4a42e1
--- a/epan/dissectors/packet-steam-ihs-discovery.c
4a42e1
+++ b/epan/dissectors/packet-steam-ihs-discovery.c
4a42e1
@@ -491,9 +491,7 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree
4a42e1
     protobuf_desc_t pb = { tvb, offset, bytes_left };
4a42e1
     protobuf_desc_t pb2 = { tvb, 0, 0 };
4a42e1
     protobuf_tag_t tag = { 0, 0, 0 };
4a42e1
-    wmem_allocator_t* strpool;
4a42e1
     guint8 *hostname;
4a42e1
-    strpool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
4a42e1
     nstime_t timestamp;
4a42e1
     proto_tree *user_tree;
4a42e1
     proto_item *user_it;
4a42e1
@@ -522,7 +520,7 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree
4a42e1
                 value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len;;
4a42e1
                 proto_tree_add_item(tree, hf_steam_ihs_discovery_body_status_hostname, pb.tvb,
4a42e1
                         pb.offset+len, (gint)value, ENC_UTF_8|ENC_NA);
4a42e1
-                hostname = tvb_get_string_enc(strpool, pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8);
4a42e1
+                hostname = tvb_get_string_enc(wmem_packet_scope(), pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8);
4a42e1
                 if(hostname && strlen(hostname)) {
4a42e1
                     col_add_fstr(pinfo->cinfo, COL_INFO, "%s from %s", hf_steam_ihs_discovery_header_msgtype_strings[STEAMDISCOVER_MSGTYPE_CLIENTBROADCASTMSGSTATUS].strptr, hostname);
4a42e1
                 }
4a42e1
@@ -615,7 +613,6 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree
4a42e1
         }
4a42e1
         protobuf_seek_forward(&pb, len);
4a42e1
     }
4a42e1
-    wmem_destroy_allocator(strpool);
4a42e1
 }
4a42e1
 
4a42e1
 /* Dissect a CMsgRemoteDeviceAuthorizationRequest protobuf message body.
4a42e1
@@ -648,8 +645,6 @@ steamdiscover_dissect_body_authrequest(tvbuff_t *tvb, packet_info *pinfo, proto_
4a42e1
     gint64 value;
4a42e1
     protobuf_desc_t pb = { tvb, offset, bytes_left };
4a42e1
     protobuf_tag_t tag = { 0, 0, 0 };
4a42e1
-    wmem_allocator_t *strpool;
4a42e1
-    strpool = wmem_allocator_new(WMEM_ALLOCATOR_SIMPLE);
4a42e1
     guint8* devicename;
4a42e1
     while (protobuf_iter_next(&pb, &tag)) {
4a42e1
         switch(tag.field_number) {
4a42e1
@@ -665,7 +660,7 @@ steamdiscover_dissect_body_authrequest(tvbuff_t *tvb, packet_info *pinfo, proto_
4a42e1
                 value = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len;;
4a42e1
                 proto_tree_add_item(tree, hf_steam_ihs_discovery_body_authrequest_devicename, pb.tvb,
4a42e1
                         pb.offset+len, (gint)value, ENC_UTF_8|ENC_NA);
4a42e1
-                devicename = tvb_get_string_enc(strpool, pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8);
4a42e1
+                devicename = tvb_get_string_enc(wmem_packet_scope(), pb.tvb, pb.offset+len, (gint)value, ENC_UTF_8);
4a42e1
                 if (devicename && strlen(devicename)) {
4a42e1
                     col_append_fstr(pinfo->cinfo, COL_INFO, " from %s", devicename);
4a42e1
                 }
4a42e1
@@ -684,7 +679,6 @@ steamdiscover_dissect_body_authrequest(tvbuff_t *tvb, packet_info *pinfo, proto_
4a42e1
         }
4a42e1
         protobuf_seek_forward(&pb, len);
4a42e1
     }
4a42e1
-    wmem_destroy_allocator(strpool);
4a42e1
 }
4a42e1
 
4a42e1
 /* Dissect a CMsgRemoteDeviceAuthorizationResponse protobuf message body.