]> git.sur5r.net Git - openldap/commitdiff
Fix ITS#1843, ldap_pvt_str2upper NULL string
authorHoward Chu <hyc@openldap.org>
Fri, 7 Jun 2002 13:37:47 +0000 (13:37 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 7 Jun 2002 13:37:47 +0000 (13:37 +0000)
libraries/libldap/string.c

index aaf76c609d6f45174d96c833c94d0385fabc3c05..ee275baec66cee7c47a0806484fb8e1ebde1e1ec 100644 (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 );