mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
Allocate one 0-byte in asprintf replacement when len==0
Some S3 code depends on this. (cherry picked from commitdc3d5e1645
) (This used to be commit842d144b4f
)
This commit is contained in:
parent
297399d877
commit
3b63333cf2
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user