mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 09:09:54 -05:00
Fix ITS#1843, don't deref NULL string in ldap_pvt_str2upper
This commit is contained in:
parent
8101798791
commit
70092b38fb
1 changed files with 8 additions and 4 deletions
|
|
@ -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 );
|
||||
|
|
|
|||
Loading…
Reference in a new issue