Add integer wrap check.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Return the number of DFS links at the root of this share.
*********************************************************************/
-static int count_dfs_links(TALLOC_CTX *ctx, int snum)
+static size_t count_dfs_links(TALLOC_CTX *ctx, int snum)
{
TALLOC_CTX *frame = talloc_stackframe();
const struct loadparm_substitution *lp_sub =
goto out;
}
if (is_msdfs_link(conn, smb_dname)) {
+ if (cnt + 1 < cnt) {
+ cnt = 0;
+ goto out;
+ }
cnt++;
}
TALLOC_FREE(talloced);