From 6295b60676dd1edd12226bea40a0a6127ff95be8 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 6 Oct 2011 14:05:31 -0700 Subject: [PATCH] Fix UTF8StringNormalize overrun on zero-length string Detected by valgrind --- servers/slapd/schema_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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'; -- 2.39.5