From d0dd8616f1c68a868afeb8c2c5c09969e366e2c0 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 da2274c1b6..c2e79d0e0b 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -1853,7 +1853,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