[LDAP] Bugfix counting of search results.

Bug: 11761
Change-Id: Icd955b848edc9f802331f25ab1b8684aa2631553
Reviewed-on: https://code.wireshark.org/review/12184
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Michael Mann 2015-11-26 09:09:23 -05:00 committed by Anders Broman
parent d9f777c99a
commit c51f207308
2 changed files with 6 additions and 6 deletions

View File

@ -116,11 +116,12 @@ PasswordPolicyResponseValue B "1.3.6.1.4.1.42.2.27.8.5.1" "passwordPolicy"
/* XXX: the count will not work if the results span multiple TCP packets */
if(ldap_info && tree) { /* only count once - on tree pass */
if(ldap_info) { /* only count once */
switch(ProtocolOp) {
case LDAP_RES_SEARCH_ENTRY:
ldap_info->num_results++;
if (!actx->pinfo->fd->flags.visited)
ldap_info->num_results++;
proto_item_append_text(tree, " [%d result%s]",
ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
@ -135,7 +136,6 @@ PasswordPolicyResponseValue B "1.3.6.1.4.1.42.2.27.8.5.1" "passwordPolicy"
proto_item_append_text(tree, " [%d result%s]",
ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
ldap_info->num_results = 0;
break;
default:
break;

View File

@ -3220,11 +3220,12 @@ dissect_ldap_ProtocolOp(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
/* XXX: the count will not work if the results span multiple TCP packets */
if(ldap_info && tree) { /* only count once - on tree pass */
if(ldap_info) { /* only count once */
switch(ProtocolOp) {
case LDAP_RES_SEARCH_ENTRY:
ldap_info->num_results++;
if (!actx->pinfo->fd->flags.visited)
ldap_info->num_results++;
proto_item_append_text(tree, " [%d result%s]",
ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
@ -3239,7 +3240,6 @@ dissect_ldap_ProtocolOp(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset
proto_item_append_text(tree, " [%d result%s]",
ldap_info->num_results, ldap_info->num_results == 1 ? "" : "s");
ldap_info->num_results = 0;
break;
default:
break;