From 70092b38fb23b9141a2b8414fb5a9c5200f3c12d Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 7 Jun 2002 13:27:25 +0000 Subject: [PATCH] Fix ITS#1843, don't deref NULL string in ldap_pvt_str2upper --- libraries/libldap/string.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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 ); -- 2.39.5