r9766: Prevent erroneous OOM message
authorJelmer Vernooij <jelmer@samba.org>
Mon, 29 Aug 2005 23:20:40 +0000 (23:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:34:57 +0000 (13:34 -0500)
ldb_dup_val() sets out->data to NULL if in->length == 0
(This used to be commit 7ecb6988e74f4273b2ca3ea76562117e1be54b08)

source4/lib/ldb/common/attrib_handlers.c

index da2d9454190ca997d156f37194f7932abf2ee288..412146360cc3dd388a08f4d0fc1a6dab49905e29 100644 (file)
@@ -38,7 +38,7 @@ int ldb_handler_copy(struct ldb_context *ldb, void *mem_ctx,
                     const struct ldb_val *in, struct ldb_val *out)
 {
        *out = ldb_val_dup(mem_ctx, in);
                     const struct ldb_val *in, struct ldb_val *out)
 {
        *out = ldb_val_dup(mem_ctx, in);
-       if (out->data == NULL) {
+       if (in->length > 0 && out->data == NULL) {
                ldb_oom(ldb);
                return -1;
        }
                ldb_oom(ldb);
                return -1;
        }