Bug 11041 - Uninitialised variable used to compute return value in srv_send_smb()
Uninitialised variable used to compute return value in srv_send_smb()
Status: RESOLVED FIXED
Product: Samba 4.1 and newer
Classification: Unclassified
Component: File services
4.1.0
All All
: P5 normal
: ---
Assigned To: Karolin Seeger
Samba QA Contact
:
Depends on: 10880
Blocks:
  Show dependency treegraph
 
Reported: 2015-01-09 10:11 UTC by David Disseldorp
Modified: 2015-01-24 20:47 UTC (History)
2 users (show)

See Also:


Attachments
fix for v4-0-test branch (954 bytes, patch)
2015-01-09 10:21 UTC, David Disseldorp
vl: review+
jra: review+
Details
fix for v4-1-test branch (954 bytes, patch)
2015-01-09 10:22 UTC, David Disseldorp
vl: review+
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Disseldorp 2015-01-09 10:11:09 UTC
The fix for bug 10880 changed the srv_send_smb() error path such that it returns a value depending on the value of @ret:

commit 852c9ac34dbef66d0b2619554c611157c2fab771
Author: Richard Sharpe <realrichardsharpe@gmail.com>
Date:   Mon Jul 22 16:04:43 2013 -0700

    There are tests all over the SMB1 code to check that srv_send_smb fails, but it never returns false.

This change was merged to the v4-1 and v4-0 maintenance branches. A subsequent change fixed the srv_send_smb()->srv_encrypt_buffer() error path to ensure that @ret is initialised on error:

commit cc983c9a6a92f3d127ec6461b15aed3fa90e6d30
Author: Volker Lendecke <vl@samba.org>
Date:   Sun Aug 18 20:35:32 2013 +0000

    smbd: Fix CID 1063259 Uninitialized scalar variable

This change was not merged to the v4-1 and v4-0 maintenance branches, but should be given that the bug 10880 change was merged.
Comment 1 David Disseldorp 2015-01-09 10:21:10 UTC
Created attachment 10604 [details]
fix for v4-0-test branch
Comment 2 David Disseldorp 2015-01-09 10:22:49 UTC
Created attachment 10605 [details]
fix for v4-1-test branch

The fix went into master prior to the 4.2 branch, so no 4.2 merge is needed.
Comment 3 David Disseldorp 2015-01-09 10:47:54 UTC
Thanks Volker!

@Karolin, please merge to the 4.1 and 4.0 maintenance branches.
Comment 4 Karolin Seeger 2015-01-16 20:20:10 UTC
Pushed to autobuild-v4-[0|1]-test.
Comment 5 Karolin Seeger 2015-01-24 20:44:23 UTC
Pushed to v4-1-test and v4-0-test.
Closing out bug report.

Thanks!