git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
e12721f
)
Allocate one 0-byte in asprintf replacement when len==0
author
Volker Lendecke
<vl@samba.org>
Sat, 15 Mar 2008 20:47:22 +0000
(21:47 +0100)
committer
Volker Lendecke
<vl@samba.org>
Sat, 15 Mar 2008 20:50:55 +0000
(21:50 +0100)
Some S3 code depends on this.
source/lib/replace/snprintf.c
patch
|
blob
|
history
diff --git
a/source/lib/replace/snprintf.c
b/source/lib/replace/snprintf.c
index 9f8a7657e525b7653b7f6148441c83bc3255f6c5..a174dcffed765670a75e6a25d8e376cca521701d 100644
(file)
--- a/
source/lib/replace/snprintf.c
+++ b/
source/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;