From: Noel Power Date: Wed, 20 Apr 2016 13:49:44 +0000 (+0100) Subject: s4:torture:vfs: fix Invalid read of size 8 valgrind valgrind error (and segv) X-Git-Tag: talloc-2.1.7~146 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=417a58a79f712fe56a98f0bdc6e2dcf5805740f0;p=thirdparty%2Fsamba.git s4:torture:vfs: fix Invalid read of size 8 valgrind valgrind error (and segv) when running smbtorture test 'vfs.fruit.SMB2/CREATE context AAPL.SMB2/CREATE context AAPL' (on non-osx system) the following valgrind errors occur ==2419== Invalid read of size 8 ==2419== at 0x4055EA: test_aapl (fruit.c:1939) ==2419== by 0x48B452: wrap_simple_1smb2_test (smb2.c:52) ==2419== by 0x955368F: internal_torture_run_test (torture.c:442) ==2419== by 0x9553A6B: torture_run_test_restricted (torture.c:542) ==2419== by 0x26013F: run_matching (smbtorture.c:110) ==2419== by 0x260001: run_matching (smbtorture.c:95) ==2419== by 0x260001: run_matching (smbtorture.c:95) ==2419== by 0x260260: torture_run_named_tests (smbtorture.c:143) ==2419== by 0x261EDF: main (smbtorture.c:665) ==2419== Address 0x10 is not stack'd, malloc'd or (recently) free'd ==2419== =============================================================== INTERNAL ERROR: Signal 11 in pid 2419 (4.2.4) Please read the Trouble-Shooting section of the Samba HOWTO =============================================================== PANIC: internal error Signed-off-by: Noel Power Reviewed-by: Volker Lendecke Reviewed-by: Andreas Schneider --- diff --git a/source4/torture/vfs/fruit.c b/source4/torture/vfs/fruit.c index ae978c2e846..020bd1f42d8 100644 --- a/source4/torture/vfs/fruit.c +++ b/source4/torture/vfs/fruit.c @@ -1936,6 +1936,14 @@ static bool test_aapl(struct torture_context *tctx, aapl = smb2_create_blob_find(&io.out.blobs, SMB2_CREATE_TAG_AAPL); + if (aapl == NULL) { + torture_result(tctx, TORTURE_FAIL, + "(%s) unexpectedly no AAPL capabilities were returned.", + __location__); + ret = false; + goto done; + } + if (aapl->data.length != 50) { /* * uint32_t CommandCode = kAAPL_SERVER_QUERY