From: Jeremy Allison Date: Tue, 5 Jan 2016 19:05:48 +0000 (-0800) Subject: CVE-2015-7560: s3: smbd: Set return values early, allows removal of code duplication. X-Git-Tag: tdb-1.3.9~435 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=464d044145faa6db166e9bf4c080a3dd15422834;p=thirdparty%2Fsamba.git CVE-2015-7560: s3: smbd: Set return values early, allows removal of code duplication. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11648 Signed-off-by: Jeremy Allison Reviewed-by: Michael Adam --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 252be331fed..ac2987c5252 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -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; }