summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-31 22:22:37 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-05-31 22:43:28 +0200
commita8788ce5236a4fbc1c8096a0eed48638b5a03dd8 (patch)
tree950077a06fd0db0fe0247bba2f26ecdd59e7b6c6
parent0fce829de46995d474053bd581555dd40e549ff1 (diff)
downloadsamba-a8788ce5236a4fbc1c8096a0eed48638b5a03dd8.tar.gz
samba-a8788ce5236a4fbc1c8096a0eed48638b5a03dd8.tar.bz2
samba-a8788ce5236a4fbc1c8096a0eed48638b5a03dd8.zip
ldb:ldb_msg_add_steal_string - prevent also there the addition of strings with length 0
-rw-r--r--source4/lib/ldb/common/ldb_msg.c5
1 files changed, 5 insertions, 0 deletions
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);
}