summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2016-01-05 11:05:48 -0800
committerKarolin Seeger <kseeger@samba.org>2016-02-24 11:40:01 +0100
commite27f9a419420ed49190fc5ca44e984a021d8de15 (patch)
treea41c45afc7204414e5a9584d6224981a3801e051
parent2907193961139c5398c95815aaa4c501af35a507 (diff)
downloadsamba-e27f9a419420ed49190fc5ca44e984a021d8de15.tar.gz
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 <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
-rw-r--r--source3/smbd/trans2.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index a971e1427a3..e0934670197 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -238,11 +238,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;
}
@@ -292,10 +293,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;
}