From 26b33bf6146a9cd0a3defcce46d0aeddac1ab6a9 Mon Sep 17 00:00:00 2001 From: Stig Venaas Date: Tue, 16 Jul 2002 02:38:14 +0000 Subject: [PATCH] Fixes ITS#1935 --- libraries/libldap/url.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/libldap/url.c b/libraries/libldap/url.c index 6b9e756cd3..8bf8bd56d5 100644 --- a/libraries/libldap/url.c +++ b/libraries/libldap/url.c @@ -1137,12 +1137,14 @@ ldap_pvt_hex_unescape( char *s ) for ( p = s; *s != '\0'; ++s ) { if ( *s == '%' ) { - if ( *++s != '\0' ) { - *p = ldap_int_unhex( *s ) << 4; + if ( *++s == '\0' ) { + break; } - if ( *++s != '\0' ) { - *p++ += ldap_int_unhex( *s ); + *p = ldap_int_unhex( *s ) << 4; + if ( *++s == '\0' ) { + break; } + *p++ += ldap_int_unhex( *s ); } else { *p++ = *s; } -- 2.39.5