aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-smtp.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2021-08-27 14:56:00 -0400
committerAndersBroman <a.broman58@gmail.com>2021-09-01 03:54:52 +0000
commitcdfab0d6e991df2fd3591ef896ba36937a8d4dfc (patch)
tree180c49932c562eb644c5f24d6c8d8cbf13a936e3 /epan/dissectors/packet-smtp.c
parent61e66c37abb1b7f59726e4407ac8dd53e6b75cac (diff)
tvbuff: convert helper methods to pinfo->pool
A few of them just needed scratch memory, so allocate and free it manually after doing any exception-raising checks. A few others were returning memory, and needed conversion to accept a wmem scope argument.
Diffstat (limited to 'epan/dissectors/packet-smtp.c')
-rw-r--r--epan/dissectors/packet-smtp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/epan/dissectors/packet-smtp.c b/epan/dissectors/packet-smtp.c
index 7bb5c0020b..fe5bac7cba 100644
--- a/epan/dissectors/packet-smtp.c
+++ b/epan/dissectors/packet-smtp.c
@@ -971,7 +971,7 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
}
proto_tree_add_string(cmdresp_tree, hf_smtp_username, tvb, loffset + 11, linelen - 11, decrypt);
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, loffset, 11));
+ tvb_format_text(pinfo->pool, tvb, loffset, 11));
col_append_fstr(pinfo->cinfo, COL_INFO, "User: %s", format_text(pinfo->pool, decrypt, decrypt_len));
}
}
@@ -993,19 +993,19 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
decrypt = tvb_get_string_enc(pinfo->pool, tvb, loffset + 10, linelen - 10, ENC_ASCII);
decrypt_len = linelen - 10;
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, loffset, 10));
+ tvb_format_text(pinfo->pool, tvb, loffset, 10));
col_append_str(pinfo->cinfo, COL_INFO, format_text(pinfo->pool, decrypt, linelen - 10));
}
else {
base64_string = tvb_get_string_enc(pinfo->pool, tvb, loffset + 10, linelen - 10, ENC_ASCII);
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, loffset, 10));
+ tvb_format_text(pinfo->pool, tvb, loffset, 10));
dissect_ntlm_auth(tvb, pinfo, cmdresp_tree, format_text(pinfo->pool, base64_string, linelen - 10));
}
}
else {
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, loffset, 10));
+ tvb_format_text(pinfo->pool, tvb, loffset, 10));
col_append_str(pinfo->cinfo, COL_INFO, format_text(pinfo->pool, decrypt, linelen - 10));
}
}
@@ -1014,18 +1014,18 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
proto_tree_add_item(cmdresp_tree, hf_smtp_req_parameter, tvb,
loffset + 5, linelen - 5, ENC_ASCII|ENC_NA);
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, loffset, 11));
+ tvb_format_text(pinfo->pool, tvb, loffset, 11));
decode_plain_auth(tvb, pinfo, cmdresp_tree, loffset + 11, linelen - 11);
}
else if (linelen > 5) {
proto_tree_add_item(cmdresp_tree, hf_smtp_req_parameter, tvb,
loffset + 5, linelen - 5, ENC_ASCII|ENC_NA);
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, loffset, linelen));
+ tvb_format_text(pinfo->pool, tvb, loffset, linelen));
}
else {
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, loffset, linelen));
+ tvb_format_text(pinfo->pool, tvb, loffset, linelen));
}
if (smtp_data_desegment && !spd_frame_data->more_frags) {
@@ -1211,15 +1211,15 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_
if ((multiline_state != SMTP_MULTILINE_CONTINUE) &&
(multiline_state != SMTP_MULTILINE_END)) {
col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
- tvb_format_text(tvb, offset, linelen));
+ tvb_format_text(pinfo->pool, tvb, offset, linelen));
} else {
col_append_fstr(pinfo->cinfo, COL_INFO, "%s",
- tvb_format_text(tvb, offset+4, linelen-4));
+ tvb_format_text(pinfo->pool, tvb, offset+4, linelen-4));
}
}
} else {
col_append_str(pinfo->cinfo, COL_INFO,
- tvb_format_text(tvb, offset, linelen));
+ tvb_format_text(pinfo->pool, tvb, offset, linelen));
}
}