]> git.sur5r.net Git - openldap/commitdiff
fix read off by one (spotted by valgrind)
authorPierangelo Masarati <ando@openldap.org>
Sat, 12 May 2007 12:38:09 +0000 (12:38 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 12 May 2007 12:38:09 +0000 (12:38 +0000)
libraries/libldap/url.c

index 30b15d11ddf5ed1c79b58f4ac4ea350316de024f..22c8a036a5ddc51353bb2168461567ac538b64db 100644 (file)
@@ -928,7 +928,11 @@ ldap_url_parse_ext( LDAP_CONST char *url_in, LDAPURLDesc **ludpp, unsigned flags
                        }
                        /* check for Novell kludge */
                        if ( !p ) {
-                               q = next+1;
+                               if ( *next != '\0' ) {
+                                       q = &next[1];
+                               } else {
+                                       q = NULL;
+                               }
                        }
                }