1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
samba-mirror/source4
Douglas Bagnall 5259926de7 s4/torture/smb2: avoid possibly closing undefined handle
From OSS-Fuzz compilation:

Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1456:2: error: variable 'dir_handle' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
Step #3 - "compile-honggfuzz-address-x86_64":         torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
Step #3 - "compile-honggfuzz-address-x86_64":         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:748:3: note: expanded from macro 'torture_assert_ntstatus_ok_goto'
Step #3 - "compile-honggfuzz-address-x86_64":                 torture_assert_ntstatus_equal_goto(torture_ctx,expr,NT_STATUS_OK,ret,label,cmt)
Step #3 - "compile-honggfuzz-address-x86_64":                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:316:6: note: expanded from macro 'torture_assert_ntstatus_equal_goto'
Step #3 - "compile-honggfuzz-address-x86_64":         if (!NT_STATUS_EQUAL(__got, __expected)) { \
Step #3 - "compile-honggfuzz-address-x86_64":             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1582:24: note: uninitialized use occurs here
Step #3 - "compile-honggfuzz-address-x86_64":         smb2_util_close(tree, dir_handle);
Step #3 - "compile-honggfuzz-address-x86_64":                               ^~~~~~~~~~
Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1456:2: note: remove the 'if' if its condition is always false
Step #3 - "compile-honggfuzz-address-x86_64":         torture_assert_ntstatus_ok_goto(tctx, status, ret, done,
Step #3 - "compile-honggfuzz-address-x86_64":         ^
Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:748:3: note: expanded from macro 'torture_assert_ntstatus_ok_goto'
Step #3 - "compile-honggfuzz-address-x86_64":                 torture_assert_ntstatus_equal_goto(torture_ctx,expr,NT_STATUS_OK,ret,label,cmt)
Step #3 - "compile-honggfuzz-address-x86_64":                 ^
Step #3 - "compile-honggfuzz-address-x86_64": ../../lib/torture/torture.h:316:2: note: expanded from macro 'torture_assert_ntstatus_equal_goto'
Step #3 - "compile-honggfuzz-address-x86_64":         if (!NT_STATUS_EQUAL(__got, __expected)) { \
Step #3 - "compile-honggfuzz-address-x86_64":         ^
Step #3 - "compile-honggfuzz-address-x86_64": ../../source4/torture/smb2/dir.c:1434:2: note: variable 'dir_handle' is declared here
Step #3 - "compile-honggfuzz-address-x86_64":         struct smb2_handle dir_handle;
Step #3 - "compile-honggfuzz-address-x86_64":         ^

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Tue Dec 13 07:45:20 UTC 2022 on sn-devel-184
2022-12-13 07:45:20 +00:00
..
auth CVE-2021-20251: s4:auth: fix use after free in authsam_logon_success_accounting() 2022-11-24 11:01:37 +00:00
cldap_server cldap_server: Align integer types 2022-12-12 21:16:33 +00:00
client s4:client: Fix shellcheck errors in test_smbclient.sh 2022-08-22 14:20:36 +00:00
cluster dbwrap: Remove calls to loadparm 2018-04-24 01:53:19 +02:00
dns_server CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message 2022-07-27 10:52:36 +00:00
dsdb s4-join: Fix typos in recent GET_ANC patch set 2022-10-21 03:57:33 +00:00
echo_server s4: rename source4/smbd/ to source4/samba/ 2020-11-27 10:07:18 +00:00
include lib: Remove smb_threads from includes.h 2022-04-26 21:41:29 +00:00
kdc s4:kdc: make sure reset_bad_password_netlogon() stops subreq before return 2022-11-24 11:01:37 +00:00
ldap_server s4:ldap_server: let ldapsrv_call_writev_start use conn_idle_time to limit the time 2022-10-19 17:13:39 +00:00
lib s4:messaging: add irpc_bh_do_ndr_print() in order to debug irpc calls 2022-11-24 11:01:37 +00:00
libcli s4: libcli: Ignore errors when getting A records after fetching AAAA records. 2022-11-09 20:34:07 +00:00
libnet lib/krb5_wrap: remove unused keep_old_entries argument from smb_krb5_kt_add_entry() 2022-10-27 21:14:43 +00:00
librpc librpc: Avoid an else 2022-10-27 18:18:36 +00:00
nbt_server CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message 2022-07-27 10:52:36 +00:00
ntp_signd s4: rename source4/smbd/ to source4/samba/ 2020-11-27 10:07:18 +00:00
ntvfs ntvfs: Remove orphans from 2006 2022-10-27 18:18:36 +00:00
param python: whitespace fixes 2022-10-03 20:03:32 +00:00
rpc_server rpc_server: Remove an unneeded #include 2022-10-27 18:18:36 +00:00
samba s4/server: stop suggesting ntvfs in error message 2022-09-16 05:46:35 +00:00
script s4:script: Fix shellcheck errors in find_unused_options.sh 2022-08-22 14:20:36 +00:00
scripting samba-tool: binary uses samba_tool function 2022-09-08 22:34:36 +00:00
selftest tests/krb5: Add tests of PAC group handling 2022-11-08 03:37:37 +00:00
setup python:tests: Allocate OID range for testing to avoid collisions 2022-08-25 13:55:47 +00:00
smb_server s4:smb_server: don't set mapped_state explicitly in auth_usersupplied_info 2022-03-10 03:16:35 +00:00
torture s4/torture/smb2: avoid possibly closing undefined handle 2022-12-13 07:45:20 +00:00
utils s4:utils: Fix shellcheck errors in test_samba_tool.sh 2022-08-22 20:35:36 +00:00
winbind CVE-2022-32746 ldb: Make use of functions for appending to an ldb_message 2022-07-27 10:52:36 +00:00
wrepl_server s4: rename source4/smbd/ to source4/samba/ 2020-11-27 10:07:18 +00:00
.clang_complete
.valgrind_suppressions
wscript_build s4:client: Migrate cifsdd to new cmdline option parser 2021-06-16 00:34:38 +00:00