From a48baaa9351c42a6a9998914e172475b7d3bbf7f Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 15 Mar 2006 03:27:03 +0000 Subject: r14418: Try and fix Coverity #39 and #40 by making the implicit function contract explicit. Jeremy. (This used to be commit 6de5e9ae4628d384631db9b66e22d439a303b75c) --- source3/libsmb/libsmbclient.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/libsmb') 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 */ -- cgit