libsmbconf: fix segfault in listing share names / config.
authorMichael Adam <obnox@samba.org>
Wed, 16 Apr 2008 20:42:49 +0000 (22:42 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 16 Apr 2008 20:44:04 +0000 (22:44 +0200)
Discovered by Günther while giving a talk. - Sorry Günther!

Michael
(This used to be commit 518f4d4e6662138a2e71acc2296acedefc7c739a)

source3/lib/smbconf/smbconf_reg.c

index 39b05f7016e6d54060a23c151500c6d512a0e054..930999cc3fc0cd484b18a5f09012d737c5640070 100644 (file)
@@ -784,7 +784,7 @@ static WERROR smbconf_reg_get_share_names(struct smbconf_ctx *ctx,
        /* make sure "global" is always listed first */
        if (smbconf_share_exists(ctx, GLOBAL_NAME)) {
                werr = smbconf_add_string_to_array(tmp_ctx, &tmp_share_names,
-                                                  1, GLOBAL_NAME);
+                                                  added_count, GLOBAL_NAME);
                if (!W_ERROR_IS_OK(werr)) {
                        goto done;
                }