From: Howard Chu Date: Fri, 7 Jun 2002 13:37:47 +0000 (+0000) Subject: Fix ITS#1843, ldap_pvt_str2upper NULL string X-Git-Tag: OPENLDAP_REL_ENG_2_0_24~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66bdd634fbe0b9fb1f80b083f9c5f856daeca815;p=thirdparty%2Fopenldap.git Fix ITS#1843, ldap_pvt_str2upper NULL string --- 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 );