aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ssl-utils.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2014-07-30 15:07:24 +0200
committerMichael Mann <mmann78@netscape.net>2014-07-30 16:25:33 +0000
commit9ed85d1de980cb92c1a5d14f400dec2ac98eb6d9 (patch)
treef6a1ea36c7a6ad7f995490ba6937ef14f3adb86b /epan/dissectors/packet-ssl-utils.c
parentdcf6d44b7f5e69e08be8ccd452b87733326053cc (diff)
Fix use of uninitialized field
ssl_print_string uses out->data_len to determine the length of the printed data, but this was not set. Use ssl_data_set for that and add an additional DISSECTOR_ASSERT just in case we change something here. Reported by Alexis La Goutte, found by Clang static analyzer. Change-Id: I630a9193ff1ece86a0a46924dd86591fedf5c595 Reviewed-on: https://code.wireshark.org/review/3261 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ssl-utils.c')
-rw-r--r--epan/dissectors/packet-ssl-utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/epan/dissectors/packet-ssl-utils.c b/epan/dissectors/packet-ssl-utils.c
index bb4423dd5f..0dad0b01df 100644
--- a/epan/dissectors/packet-ssl-utils.c
+++ b/epan/dissectors/packet-ssl-utils.c
@@ -2265,7 +2265,8 @@ ssl3_generate_export_iv(StringInfo *r1, StringInfo *r2,
ssl_md5_final(tmp,&md5);
ssl_md5_cleanup(&md5);
- memcpy(out->data, tmp, out_len);
+ DISSECTOR_ASSERT(out_len <= sizeof(tmp));
+ ssl_data_set(out, tmp, out_len);
ssl_print_string("export iv", out);
}