Fix ITS#1843, don't deref NULL string in ldap_pvt_str2upper

This commit is contained in:
Howard Chu 2002-06-07 13:27:25 +00:00
parent 8101798791
commit 70092b38fb

View file

@ -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 );