diff options
author | Douglas Bagnall <douglas.bagnall@catalyst.net.nz> | 2017-01-23 22:50:19 -0500 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2017-01-24 08:11:54 -0800 |
commit | 8df617e13b42e83a38b2423a487ed1032b60018f (patch) | |
tree | c7d0f9fdb9ee0273121e72e7355a91622ac0a53c /usr/src/lib/libldap5/sources/ldap/common | |
parent | 6a81003a6cb2a9fe9b6a4acbc0c1a6ec5c0ebbec (diff) | |
download | illumos-gate-8df617e13b42e83a38b2423a487ed1032b60018f.tar.gz |
7802 libldap fix from Mozilla in unescape
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Robert Mustacchi <rm@joyent.com>
Diffstat (limited to 'usr/src/lib/libldap5/sources/ldap/common')
-rw-r--r-- | usr/src/lib/libldap5/sources/ldap/common/unescape.c | 11 |
1 files changed, 7 insertions, 4 deletions
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; } |