1
0
mirror of https://github.com/php/php-src.git synced 2026-04-01 05:02:27 +02:00

Correctly add to the length of the final string

This commit is contained in:
Chad Sikorra
2016-06-26 17:29:07 -05:00
parent e85a2e360c
commit f910ca259f

View File

@@ -2837,7 +2837,7 @@ static zend_string* php_ldap_do_escape(const zend_bool *map, const char *value,
if (flags & PHP_LDAP_ESCAPE_DN && value[0] == ' ') {
len += 2;
}
if (flags & PHP_LDAP_ESCAPE_DN && valuelen && value[valuelen - 1] == ' ') {
if (flags & PHP_LDAP_ESCAPE_DN && valuelen > 1 && value[valuelen - 1] == ' ') {
len += 2;
}