packet-ldap: fix regression for SASL handling
commit1d623fd54116fbe234300712a9cbf04560802e9f
authorStefan Metzmacher <metze@samba.org>
Tue, 6 Apr 2021 18:52:17 +0000 (6 20:52 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 16 Apr 2021 10:54:43 +0000 (16 12:54 +0200)
tree6238f17652d07897a812c023780b8e638fa4a19b
parente2c7dc66276c8cc68be23de61f5ce2c5238818c7
packet-ldap: fix regression for SASL handling

commit 19b3376a24192319a008399e8c44f1655f6dcebd
("LDAP bogus malformed errors: decoding encrypted data")
introduced 2 problems:

- guint decr_len = tvb_reported_length(decr_tvb); was
  always called with decr_tvb==NULL

- dissect_ldap_payload() was not called if sasl_tree is NULL,
  it needs to be called even if the tree pointer are NULL
  in order to have the COL_INFO setup correctly.

I guess this should also be backported to stable branches
(together with 2e6d3b571b50f6a0df31787cb95ba0f66c4fa85f
 "LDAP: SASL Buffer doesn't include Length field")

https://gitlab.com/wireshark/wireshark/-/issues/17347

Signed-off-by: Stefan Metzmacher <metze@samba.org>
epan/dissectors/asn1/ldap/packet-ldap-template.c
epan/dissectors/packet-ldap.c