svn commit: samba r14418 - in branches/SAMBA_3_0/source/libsmb: .

jra at samba.org jra at samba.org
Wed Mar 15 03:27:03 GMT 2006


Author: jra
Date: 2006-03-15 03:27:03 +0000 (Wed, 15 Mar 2006)
New Revision: 14418

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14418

Log:
Try and fix Coverity #39 and #40 by making the
implicit function contract explicit.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/libsmb/libsmbclient.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2006-03-15 03:00:55 UTC (rev 14417)
+++ branches/SAMBA_3_0/source/libsmb/libsmbclient.c	2006-03-15 03:27:03 UTC (rev 14418)
@@ -4826,11 +4826,19 @@
                                     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 */
 



More information about the samba-cvs mailing list