svn commit: samba r17865 - in branches: SAMBA_3_0/source/lib SAMBA_3_0_23/source/lib

jra at samba.org jra at samba.org
Mon Aug 28 02:24:15 GMT 2006


Author: jra
Date: 2006-08-28 02:24:15 +0000 (Mon, 28 Aug 2006)
New Revision: 17865

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

Log:
Fix what the Stanford checker reported as a possible
deref. I think this is a false positive, but it's
an easy extra check to add here.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/lib/xfile.c
   branches/SAMBA_3_0_23/source/lib/xfile.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/xfile.c
===================================================================
--- branches/SAMBA_3_0/source/lib/xfile.c	2006-08-28 02:13:50 UTC (rev 17864)
+++ branches/SAMBA_3_0/source/lib/xfile.c	2006-08-28 02:24:15 UTC (rev 17865)
@@ -267,7 +267,9 @@
 	f->bufused -= ret;
 	if (f->bufused > 0) {
 		f->flags |= X_FLAG_ERROR;
-		memmove(f->buf, ret + (char *)f->buf, f->bufused);
+		if (f->buf) {
+			memmove(f->buf, ret + (char *)f->buf, f->bufused);
+		}
 		return -1;
 	}
 

Modified: branches/SAMBA_3_0_23/source/lib/xfile.c
===================================================================
--- branches/SAMBA_3_0_23/source/lib/xfile.c	2006-08-28 02:13:50 UTC (rev 17864)
+++ branches/SAMBA_3_0_23/source/lib/xfile.c	2006-08-28 02:24:15 UTC (rev 17865)
@@ -267,7 +267,9 @@
 	f->bufused -= ret;
 	if (f->bufused > 0) {
 		f->flags |= X_FLAG_ERROR;
-		memmove(f->buf, ret + (char *)f->buf, f->bufused);
+		if (f->buf) {
+			memmove(f->buf, ret + (char *)f->buf, f->bufused);
+		}
 		return -1;
 	}
 



More information about the samba-cvs mailing list