aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/asn1/cms/cms.cnf
diff options
context:
space:
mode:
authorРоман Донченко <dpb@corrigendum.ru>2016-12-28 22:59:50 +0300
committerAnders Broman <a.broman58@gmail.com>2016-12-30 12:43:36 +0000
commit2f096100f5bcf5284111e62b51af23a9cbf4149b (patch)
treeb68e139790f3238b36c67935841a3bfad49ae29f /epan/dissectors/asn1/cms/cms.cnf
parente7a4c82b85d2149eeb54ff55b6a52ba11f79fd0f (diff)
cms: don't assert if eContent fails to be dissected
If eContent is not an octet string, content_tvb will be null, and attempting to use it will trigger an assertion. Besides ill-formed files, this can also occur in old-style PKCS #7 files, since in PKCS #7 the corresponding field has the ANY type, rather than OCTET STRING. Change-Id: I9a5bce983aa82107a9602317737c183461cac7f3 Reviewed-on: https://code.wireshark.org/review/19448 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/asn1/cms/cms.cnf')
-rw-r--r--epan/dissectors/asn1/cms/cms.cnf7
1 files changed, 5 insertions, 2 deletions
diff --git a/epan/dissectors/asn1/cms/cms.cnf b/epan/dissectors/asn1/cms/cms.cnf
index 045dca9e9e..af60947754 100644
--- a/epan/dissectors/asn1/cms/cms.cnf
+++ b/epan/dissectors/asn1/cms/cms.cnf
@@ -102,9 +102,12 @@ RevocationInfoChoice/other otherRIC
#.FN_BODY EncapsulatedContentInfo/eContent
offset = dissect_ber_octet_string(FALSE, actx, tree, tvb, offset, hf_index, &content_tvb);
- proto_item_set_text(actx->created_item, "eContent (%%u bytes)", tvb_reported_length (content_tvb));
- call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL);
+ if(content_tvb) {
+ proto_item_set_text(actx->created_item, "eContent (%%u bytes)", tvb_reported_length (content_tvb));
+
+ call_ber_oid_callback(object_identifier_id, content_tvb, 0, actx->pinfo, top_tree ? top_tree : tree, NULL);
+ }
#.FN_PARS OtherRecipientInfo/oriType
FN_VARIANT = _str VAL_PTR = &object_identifier_id