From a8788ce5236a4fbc1c8096a0eed48638b5a03dd8 Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Mon, 31 May 2010 22:22:37 +0200 Subject: ldb:ldb_msg_add_steal_string - prevent also there the addition of strings with length 0 --- source4/lib/ldb/common/ldb_msg.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/lib') diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c index 0322446033..2cfc449986 100644 --- a/source4/lib/ldb/common/ldb_msg.c +++ b/source4/lib/ldb/common/ldb_msg.c @@ -255,6 +255,11 @@ int ldb_msg_add_steal_string(struct ldb_message *msg, val.data = (uint8_t *)str; val.length = strlen(str); + if (val.length == 0) { + /* allow empty strings as non-existent attributes */ + return LDB_SUCCESS; + } + return ldb_msg_add_steal_value(msg, attr_name, &val); } -- cgit