From: Howard Chu Date: Fri, 7 Jun 2002 13:27:25 +0000 (+0000) Subject: Fix ITS#1843, don't deref NULL string in ldap_pvt_str2upper X-Git-Tag: OPENLDAP_REL_ENG_2_MP~9 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=70092b38fb23b9141a2b8414fb5a9c5200f3c12d;p=openldap Fix ITS#1843, don't deref NULL string in ldap_pvt_str2upper --- diff --git a/libraries/libldap/string.c b/libraries/libldap/string.c index aaf76c609d..ee275baec6 100644 --- a/libraries/libldap/string.c +++ b/libraries/libldap/string.c @@ -103,8 +103,10 @@ ldap_pvt_str2upper( char *str ) char *s; /* to upper */ - for ( s = str; *s; s++ ) { - *s = TOUPPER( (unsigned char) *s ); + if ( str ) { + for ( s = str; *s; s++ ) { + *s = TOUPPER( (unsigned char) *s ); + } } return( str ); @@ -116,8 +118,10 @@ ldap_pvt_str2lower( char *str ) char *s; /* to lower */ - for ( s = str; *s; s++ ) { - *s = TOLOWER( (unsigned char) *s ); + if ( str ) { + for ( s = str; *s; s++ ) { + *s = TOLOWER( (unsigned char) *s ); + } } return( str );