aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/c1222
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2021-07-23 15:21:02 -0400
committerWireshark GitLab Utility <gerald+gitlab-utility@wireshark.org>2021-07-26 15:30:11 +0000
commite69446aa55d293412002375a549e85327267e65b (patch)
tree784bba0753e5f961df780eb5c9c613828cefca83 /epan/dissectors/asn1/c1222
parent3467b98eb72f8971c83b25b920419b8d0d49016a (diff)
asn1: convert most dissectors to pinfo->pool
Part 1/2 as the commits were too big for CI. Largely find/replace, with a few manual tweaks. Then regenerate the asn1 dissector sources and make sure everything still builds. There are a handful of cases I skipped as too complex, but this covers most of the asn1 dissectors.
Diffstat (limited to 'epan/dissectors/asn1/c1222')
-rw-r--r--epan/dissectors/asn1/c1222/packet-c1222-template.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/asn1/c1222/packet-c1222-template.c b/epan/dissectors/asn1/c1222/packet-c1222-template.c
index 13de7f21d1..f9d25c9cb6 100644
--- a/epan/dissectors/asn1/c1222/packet-c1222-template.c
+++ b/epan/dissectors/asn1/c1222/packet-c1222-template.c
@@ -299,11 +299,11 @@ static uat_t *c1222_uat;
#define FILL_START int length, start_offset = offset;
#define FILL_TABLE(fieldname) \
length = offset - start_offset; \
- fieldname = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(actx->pinfo->pool, tvb, start_offset, length); \
fieldname##_len = length;
#define FILL_TABLE_TRUNCATE(fieldname, len) \
length = 1 + 2*(offset - start_offset); \
- fieldname = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(actx->pinfo->pool, tvb, start_offset, length); \
fieldname##_len = len;
#define FILL_TABLE_APTITLE(fieldname) \
length = offset - start_offset; \
@@ -311,7 +311,7 @@ static uat_t *c1222_uat;
case 0x80: /* relative OID */ \
tvb_ensure_bytes_exist(tvb, start_offset, length); \
fieldname##_len = length + c1222_baseoid_len; \
- fieldname = (guint8 *)wmem_alloc(wmem_packet_scope(), fieldname##_len); \
+ fieldname = (guint8 *)wmem_alloc(actx->pinfo->pool, fieldname##_len); \
fieldname[0] = 0x06; /* create absolute OID tag */ \
fieldname[1] = (fieldname##_len - 2) & 0xff; \
memcpy(&(fieldname[2]), c1222_baseoid, c1222_baseoid_len); \
@@ -319,7 +319,7 @@ static uat_t *c1222_uat;
break; \
case 0x06: /* absolute OID */ \
default: \
- fieldname = (guint8 *)tvb_memdup(wmem_packet_scope(), tvb, start_offset, length); \
+ fieldname = (guint8 *)tvb_memdup(actx->pinfo->pool, tvb, start_offset, length); \
fieldname##_len = length; \
break; \
}
@@ -398,7 +398,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
user_id = tvb_get_ntohs(tvb, *offset);
proto_tree_add_uint(tree, hf_c1222_logon_id, tvb, *offset, 2, user_id);
*offset += 2;
- proto_tree_add_item_ret_string(tree, hf_c1222_logon_user, tvb, *offset, 10, ENC_ASCII|ENC_NA, wmem_packet_scope(), &user_name);
+ proto_tree_add_item_ret_string(tree, hf_c1222_logon_user, tvb, *offset, 10, ENC_ASCII|ENC_NA, pinfo->pool, &user_name);
*offset += 10;
*length -= 12;
proto_item_set_text(tree, "C12.22 EPSEM: %s (id %d, user \"%s\")",
@@ -409,7 +409,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
break;
case C1222_CMD_SECURITY:
if (*length >= 20) {
- proto_tree_add_item_ret_string(tree, hf_c1222_security_password, tvb, *offset, 20, ENC_ASCII|ENC_NA, wmem_packet_scope(), &password);
+ proto_tree_add_item_ret_string(tree, hf_c1222_security_password, tvb, *offset, 20, ENC_ASCII|ENC_NA, pinfo->pool, &password);
*offset += 20;
*length -= 20;
if (*length >= 2) {
@@ -433,7 +433,7 @@ parse_c1222_detailed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int cm
proto_tree_add_uint(tree, hf_c1222_auth_len, tvb, *offset, 1, auth_len);
*offset += 1;
if (*length >= auth_len) {
- auth_req = tvb_bytes_to_str(wmem_packet_scope(), tvb, *offset, auth_len);
+ auth_req = tvb_bytes_to_str(pinfo->pool, tvb, *offset, auth_len);
proto_tree_add_item(tree, hf_c1222_auth_data, tvb, *offset, auth_len, ENC_NA);
*offset += auth_len;
*length -= auth_len + 1;
@@ -973,7 +973,7 @@ dissect_epsem(tvbuff_t *tvb, int offset, guint32 len, packet_info *pinfo, proto_
if (len2 <= 0)
return offset;
epsem_buffer = tvb_new_subset_remaining(tvb, offset);
- buffer = (guchar *)tvb_memdup(wmem_packet_scope(), tvb, offset, len2);
+ buffer = (guchar *)tvb_memdup(pinfo->pool, tvb, offset, len2);
if (c1222_decrypt) {
if (!decrypt_packet(buffer, len2, FALSE)) {
crypto_bad = TRUE;