libgpo: default to empty values if none are there
authorGünther Deschner <gd@samba.org>
Mon, 19 Sep 2016 15:11:19 +0000 (17:11 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 6 Jan 2017 11:28:19 +0000 (12:28 +0100)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
libgpo/gpo_ini.c

index 0d45dbb2de4cb7268dadefba271144e55cdd73f8..95673bce13a7e257e9ded80603625b42510511cc 100644 (file)
@@ -56,7 +56,7 @@ static bool store_keyval_pair(const char *key, const char *value, void *ctx_ptr)
        }
 
        ctx->data[ctx->keyval_count]->key = talloc_asprintf(ctx, "%s:%s", ctx->current_section, key);
-       ctx->data[ctx->keyval_count]->val = talloc_strdup(ctx, value);
+       ctx->data[ctx->keyval_count]->val = talloc_strdup(ctx, value ? value : "");
 
        if (!ctx->data[ctx->keyval_count]->key ||
            !ctx->data[ctx->keyval_count]->val) {