From: Volker Lendecke Date: Sun, 22 Jun 2008 10:50:30 +0000 (+0200) Subject: Fix an uninitialized variable access in callers of parse_msdfs_symlink X-Git-Tag: samba-3.3.0pre1~822 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=73172113484a2c6c9af014f59e84707716c61a7d;p=thirdparty%2Fsamba.git Fix an uninitialized variable access in callers of parse_msdfs_symlink 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. --- diff --git a/source/smbd/msdfs.c b/source/smbd/msdfs.c index 25b22f4cc04..bdcdc92df20 100644 --- a/source/smbd/msdfs.c +++ b/source/smbd/msdfs.c @@ -370,9 +370,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; }