summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-08-28 02:24:15 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:55 -0500
commit8be645836834720967d21d96e0e9e300adfcafaf (patch)
tree27a5b4e0b67e0950b81c842f1b4e41650c41e6e3
parent6f9ce7def71ac7156be1583a6a0d610414330c98 (diff)
downloadsamba-8be645836834720967d21d96e0e9e300adfcafaf.tar.gz
samba-8be645836834720967d21d96e0e9e300adfcafaf.tar.bz2
samba-8be645836834720967d21d96e0e9e300adfcafaf.zip
r17865: 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. (This used to be commit 7d3b11ab18e2c793d43b6eed1803f2183b7b2daa)
-rw-r--r--source3/lib/xfile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/xfile.c b/source3/lib/xfile.c
index 8a6776b5f9..503e8c8359 100644
--- a/source3/lib/xfile.c
+++ b/source3/lib/xfile.c
@@ -267,7 +267,9 @@ int x_fflush(XFILE *f)
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;
}