Fix an uninitialized variable access in callers of parse_msdfs_symlink
authorVolker Lendecke <vl@samba.org>
Sun, 22 Jun 2008 10:50:30 +0000 (12:50 +0200)
committerVolker Lendecke <vl@samba.org>
Sun, 22 Jun 2008 10:57:43 +0000 (12:57 +0200)
At least form_junctions() does not initialize refcount, and I don't see it in
get_referred_path(). For the latters, the callers might initialize it. But even
if they did, I think parse_msdfs_symlink() should unconditionally return the
number of referrals it found. I don't think it makes sense to count them up
from somewhere else.

source/smbd/msdfs.c

index 6fb523f4723a5e957bf6b8e547d796726d3880bd..0bbc75250289e82ced55e1dc8f4845b32c2dab7c 100644 (file)
@@ -367,9 +367,10 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
                reflist[i].ttl = REFERRAL_TTL;
                DEBUG(10, ("parse_msdfs_symlink: Created alt path: %s\n",
                                        reflist[i].alternate_path));
-               *refcount += 1;
        }
 
+       *refcount = count;
+
        TALLOC_FREE(alt_path);
        return True;
 }