]> granicus.if.org Git - php/commitdiff
Correctly add to the length of the final string
authorChad Sikorra <Chad.Sikorra@gmail.com>
Sun, 26 Jun 2016 22:10:51 +0000 (17:10 -0500)
committerChad Sikorra <Chad.Sikorra@gmail.com>
Sun, 26 Jun 2016 22:10:51 +0000 (17:10 -0500)
ext/ldap/ldap.c

index 915ac3febe1b12d7208a42b405a4c48a343bc1ae..bdb90f8addba3eef88888768d01fefcb7f5176f7 100644 (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] == ' ') {
+       if (flags & PHP_LDAP_ESCAPE_DN && valuelen && value[valuelen - 1] == ' ') {
                len += 2;
        }