From 8df617e13b42e83a38b2423a487ed1032b60018f Mon Sep 17 00:00:00 2001 From: Douglas Bagnall Date: Mon, 23 Jan 2017 22:50:19 -0500 Subject: 7802 libldap fix from Mozilla in unescape Reviewed by: Dan McDonald Reviewed by: Garrett D'Amore Approved by: Robert Mustacchi --- usr/src/lib/libldap5/sources/ldap/common/unescape.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'usr/src/lib/libldap5/sources/ldap') diff --git a/usr/src/lib/libldap5/sources/ldap/common/unescape.c b/usr/src/lib/libldap5/sources/ldap/common/unescape.c index 65de7c03b4..70aae09642 100644 --- a/usr/src/lib/libldap5/sources/ldap/common/unescape.c +++ b/usr/src/lib/libldap5/sources/ldap/common/unescape.c @@ -44,12 +44,15 @@ nsldapi_hex_unescape( char *s ) for ( p = s; *s != '\0'; ++s ) { if ( *s == '%' ) { - if ( *++s != '\0' ) { - *p = unhex( *s ) << 4; + if ( *++s == '\0' ) { + break; } - if ( *++s != '\0' ) { - *p++ += unhex( *s ); + *p = unhex( *s ) << 4; + if ( *++s == '\0' ) { + break; } + *p++ += unhex( *s ); + } else { *p++ = *s; } -- cgit v1.2.3