summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-03-15 21:47:22 +0100
committerVolker Lendecke <vl@samba.org>2008-03-15 21:50:55 +0100
commit3351bdeb236df9f35b4be89ddb15ee7cff63994a (patch)
tree8d698413b1ab4a064ab3e1e2c46f10f980618808 /source3/lib
parent0bdba8d59abf3de7919f77073ab3534cab69995a (diff)
downloadsamba-3351bdeb236df9f35b4be89ddb15ee7cff63994a.tar.gz
samba-3351bdeb236df9f35b4be89ddb15ee7cff63994a.tar.bz2
samba-3351bdeb236df9f35b4be89ddb15ee7cff63994a.zip
Allocate one 0-byte in asprintf replacement when len==0
Some S3 code depends on this. (This used to be commit dc3d5e16452bf30055638ba3cfe99097fb557156)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/replace/snprintf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/replace/snprintf.c b/source3/lib/replace/snprintf.c
index 9f8a7657e5..a174dcffed 100644
--- a/source3/lib/replace/snprintf.c
+++ b/source3/lib/replace/snprintf.c
@@ -1264,7 +1264,7 @@ static int add_cnk_list_entry(struct pr_chunk_x **list,
VA_COPY(ap2, ap);
ret = vsnprintf(NULL, 0, format, ap2);
va_end(ap2);
- if (ret <= 0) return ret;
+ if (ret < 0) return ret;
(*ptr) = (char *)malloc(ret+1);
if (!*ptr) return -1;