From 7601a1f3fb2f4f352382619f5aab95883a6edf2c Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 12 May 2007 12:38:09 +0000 Subject: [PATCH] fix read off by one (spotted by valgrind) --- libraries/libldap/url.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; + } } } -- 2.39.5