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)
committerKarolin Seeger <kseeger@samba.org>
Wed, 24 Feb 2016 10:38:53 +0000 (11:38 +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 3fca8f2e2cc3dae1269bb4a94d067fb5c791af49..3d16d6e3d3976b3bb7ad6c8c2d308028595e905c 100644 (file)
@@ -237,11 +237,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;
        }
 
@@ -291,10 +292,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;
        }