com php-src: Correctly add to the length of the final string: ext/ldap/ldap.c

From: Date: Sun, 26 Jun 2016 22:29:07 +0000
Subject: com php-src: Correctly add to the length of the final string: ext/ldap/ldap.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-92859@lists.php.net to get a copy of this message
Commit: f910ca259f9be7dad7804eda19505490b4d5f132 Author: Chad Sikorra <Chad.Sikorra@gmail.com> Sun, 26 Jun 2016 17:29:07 -0500 Parents: e85a2e360c0e0efc1130c27b8f3c2cb7dc6b6726 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f910ca259f9be7dad7804eda19505490b4d5f132 Log: Correctly add to the length of the final string Changed paths: M ext/ldap/ldap.c Diff: diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index bdb90f8..3b95286 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -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; }

« previous php.cvs (#92859) next »