From: Howard Chu Date: Thu, 6 Oct 2011 21:05:31 +0000 (-0700) Subject: Fix UTF8StringNormalize overrun on zero-length string X-Git-Tag: OPENLDAP_REL_ENG_2_4_27~231 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6295b60676dd1edd12226bea40a0a6127ff95be8;p=openldap Fix UTF8StringNormalize overrun on zero-length string Detected by valgrind --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 67508fc70d..56d690ba83 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -1852,7 +1852,7 @@ UTF8StringNormalize( } nvalue.bv_val[nvalue.bv_len] = '\0'; - } else { + } else if ( nvalue.bv_len ) { /* string of all spaces is treated as one space */ nvalue.bv_val[0] = ' '; nvalue.bv_val[1] = '\0';