diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2015-10-19 14:23:12 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2015-10-19 13:25:45 +0000 |
commit | 71b3d384cf53a4a7706514e187c0a1bdfebd38d4 (patch) | |
tree | 3ec47b01605769fc5bbf76746d3fca49fe630cbc /epan/dissectors/packet-x509af.c | |
parent | e8a37694cebe030252f028e926ee5d4fd966a812 (diff) |
X509AF: ensure that BER dissector successfully decoded a bit string before calling RSA Public Key dissection
Bug: 11612
Change-Id: Ia1279b5991604631241398ab19f0652e36a2114e
Reviewed-on: https://code.wireshark.org/review/11144
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-x509af.c')
-rw-r--r-- | epan/dissectors/packet-x509af.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/epan/dissectors/packet-x509af.c b/epan/dissectors/packet-x509af.c index 27d9ff3ab2..5748ffd0ad 100644 --- a/epan/dissectors/packet-x509af.c +++ b/epan/dissectors/packet-x509af.c @@ -350,14 +350,14 @@ dissect_x509af_SubjectName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int off static int dissect_x509af_T_subjectPublicKey(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { #line 91 "../../asn1/x509af/x509af.cnf" - tvbuff_t *bs_tvb; + tvbuff_t *bs_tvb = NULL; dissect_ber_bitstring(FALSE, actx, NULL, tvb, offset, NULL, -1, -1, &bs_tvb); /* See RFC 3279 for possible subjectPublicKey values given an Algorithm ID. * The contents of subjectPublicKey are always explicitly tagged. */ - if (!g_strcmp0(algorithm_id, "1.2.840.113549.1.1.1")) { /* id-rsa */ + if (bs_tvb && !g_strcmp0(algorithm_id, "1.2.840.113549.1.1.1")) { /* id-rsa */ offset += dissect_pkcs1_RSAPublicKey(FALSE, bs_tvb, 0, actx, tree, hf_index); } else { |