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:38:53 +0100
commit39aaef0dcb14d3d2299021c66cacfac51cddf7fd (patch)
tree7dca31b10aa84b9f949660adee301493325b3c88
parente3875621cec2b0a301be976331ade51baa087b68 (diff)
downloadsamba-39aaef0dcb14d3d2299021c66cacfac51cddf7fd.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 3fca8f2e2cc..3d16d6e3d39 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -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;
}