From: Andreas Schneider Date: Thu, 16 Feb 2017 16:52:41 +0000 (+0100) Subject: s4:torture: Make sure handles are initialized X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=8a1b998acb3592ad67bb72db79965bae436748ec s4:torture: Make sure handles are initialized The CHECK_STATUS macro might goto done which checks the values of the handle so they should be initialized in this case. Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison --- diff --git a/source4/torture/smb2/rename.c b/source4/torture/smb2/rename.c index 1a490f312406..96526435e467 100644 --- a/source4/torture/smb2/rename.c +++ b/source4/torture/smb2/rename.c @@ -57,6 +57,8 @@ static bool torture_smb2_rename_simple(struct torture_context *torture, union smb_fileinfo fi; struct smb2_handle h1; + ZERO_STRUCT(h1); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -145,6 +147,8 @@ static bool torture_smb2_rename_simple2(struct torture_context *torture, union smb_setfileinfo sinfo; struct smb2_handle h1; + ZERO_STRUCT(h1); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -226,6 +230,8 @@ static bool torture_smb2_rename_no_sharemode(struct torture_context *torture, union smb_fileinfo fi; struct smb2_handle h1; + ZERO_STRUCT(h1); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -314,6 +320,9 @@ static bool torture_smb2_rename_with_delete_access(struct torture_context *tortu union smb_setfileinfo sinfo; struct smb2_handle fh, dh; + ZERO_STRUCT(fh); + ZERO_STRUCT(dh); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -439,6 +448,9 @@ static bool torture_smb2_rename_with_delete_access2(struct torture_context *tort union smb_setfileinfo sinfo; struct smb2_handle fh, dh; + ZERO_STRUCT(fh); + ZERO_STRUCT(dh); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -563,6 +575,9 @@ static bool torture_smb2_rename_no_delete_access(struct torture_context *torture union smb_fileinfo fi; struct smb2_handle fh, dh; + ZERO_STRUCT(fh); + ZERO_STRUCT(dh); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -697,6 +712,9 @@ static bool torture_smb2_rename_no_delete_access2(struct torture_context *tortur union smb_setfileinfo sinfo; struct smb2_handle fh, dh; + ZERO_STRUCT(fh); + ZERO_STRUCT(dh); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -820,6 +838,9 @@ static bool torture_smb2_rename_msword(struct torture_context *torture, union smb_fileinfo fi; struct smb2_handle fh, dh; + ZERO_STRUCT(fh); + ZERO_STRUCT(dh); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR); @@ -938,6 +959,9 @@ static bool torture_smb2_rename_dir_openfile(struct torture_context *torture, union smb_setfileinfo sinfo; struct smb2_handle d1, h1; + ZERO_STRUCT(d1); + ZERO_STRUCT(h1); + smb2_deltree(tree1, BASEDIR); smb2_util_rmdir(tree1, BASEDIR);