summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-03-15 03:27:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:15:29 -0500
commita48baaa9351c42a6a9998914e172475b7d3bbf7f (patch)
treedae5d177198019aa76a3c6e62e506bfa4eeaf43f
parentfa57a318b452ba7832492ee7e2ac0c28749881e0 (diff)
downloadsamba-a48baaa9351c42a6a9998914e172475b7d3bbf7f.tar.gz
samba-a48baaa9351c42a6a9998914e172475b7d3bbf7f.tar.bz2
samba-a48baaa9351c42a6a9998914e172475b7d3bbf7f.zip
r14418: Try and fix Coverity #39 and #40 by making the
implicit function contract explicit. Jeremy. (This used to be commit 6de5e9ae4628d384631db9b66e22d439a303b75c)
-rw-r--r--source3/libsmb/libsmbclient.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source3/libsmb/libsmbclient.c b/source3/libsmb/libsmbclient.c
index 4c013c4ed2..b8070283da 100644
--- a/source3/libsmb/libsmbclient.c
+++ b/source3/libsmb/libsmbclient.c
@@ -4826,11 +4826,19 @@ cacl_set(TALLOC_CTX *ctx,
CONST_DISCARD(char *, the_acl));
if (!sd) {
- errno = EINVAL;
- return -1;
+ errno = EINVAL;
+ return -1;
}
}
+ /* SMBC_XATTR_MODE_REMOVE_ALL is the only caller
+ that doesn't deref sd */
+
+ if (!sd && (mode != SMBC_XATTR_MODE_REMOVE_ALL)) {
+ errno = EINVAL;
+ return -1;
+ }
+
/* The desired access below is the only one I could find that works
with NT4, W2KP and Samba */