From: Pierangelo Masarati Date: Sat, 12 May 2007 12:38:09 +0000 (+0000) Subject: fix read off by one (spotted by valgrind) X-Git-Tag: OPENLDAP_REL_ENG_2_4_MP~494 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7601a1f3fb2f4f352382619f5aab95883a6edf2c;p=openldap fix read off by one (spotted by valgrind) --- diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 30b15d11dd..22c8a036a5 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -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; + } } }