LDAP: fix wrong use of g_strlcpy introduced in gc397add

Last parameter is the destination buffer size, not the number of bytes to copy.

Bug: 13332
Change-Id: I9a6f5231d2d7a94fd5e692e8bbf4f5dba30b7c1a
Reviewed-on: https://code.wireshark.org/review/19677
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Pascal Quantin 2017-01-19 22:34:26 +01:00 committed by Anders Broman
parent 5df8d09cdc
commit 069a532988
2 changed files with 3 additions and 3 deletions

View File

@ -1312,7 +1312,7 @@ int dissect_mscldap_string(tvbuff_t *tvb, int offset, char *str, int max_len, gb
/* The name data MUST start at offset 0 of the tvb */
compr_len = get_dns_name(tvb, offset, max_len, 0, &name, &name_len);
g_strlcpy(str, name, name_len);
g_strlcpy(str, name, max_len);
return offset + compr_len;
}

View File

@ -4232,7 +4232,7 @@ int dissect_mscldap_string(tvbuff_t *tvb, int offset, char *str, int max_len, gb
/* The name data MUST start at offset 0 of the tvb */
compr_len = get_dns_name(tvb, offset, max_len, 0, &name, &name_len);
g_strlcpy(str, name, name_len);
g_strlcpy(str, name, max_len);
return offset + compr_len;
}
@ -5878,7 +5878,7 @@ proto_reg_handoff_ldap(void)
/*--- End of included file: packet-ldap-dis-tab.c ---*/
#line 2315 "./asn1/ldap/packet-ldap-template.c"
#line 2316 "./asn1/ldap/packet-ldap-template.c"
dissector_add_uint_range_with_preference("tcp.port", TCP_PORT_RANGE_LDAP, ldap_handle);
}