]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2015-7560: s3: smbd: Set return values early, allows removal of code duplication.
authorJeremy Allison <jra@samba.org>
Tue, 5 Jan 2016 19:05:48 +0000 (11:05 -0800)
committerStefan Metzmacher <metze@samba.org>
Thu, 10 Mar 2016 05:52:23 +0000 (06:52 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
source3/smbd/trans2.c

index 252be331fedcfe0fa5bedda8c6092027fa0141b0..ac2987c52529099ca652e002860e384155bcfd98 100644 (file)
@@ -243,11 +243,12 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
        size_t num_names;
        ssize_t sizeret = -1;
 
+       if (pnames) {
+               *pnames = NULL;
+       }
+       *pnum_names = 0;
+
        if (!lp_ea_support(SNUM(conn))) {
-               if (pnames) {
-                       *pnames = NULL;
-               }
-               *pnum_names = 0;
                return NT_STATUS_OK;
        }
 
@@ -297,10 +298,6 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
 
        if (sizeret == 0) {
                TALLOC_FREE(names);
-               if (pnames) {
-                       *pnames = NULL;
-               }
-               *pnum_names = 0;
                return NT_STATUS_OK;
        }