need va_copy before va_start

reported by Nicholas Lemonias
This commit is contained in:
Damien Miller 2015-10-16 10:53:14 +11:00
parent eb6c50d82a
commit 0f754e29dd
1 changed files with 1 additions and 0 deletions

View File

@ -47,6 +47,7 @@ vasprintf(char **str, const char *fmt, va_list ap)
char *string, *newstr; char *string, *newstr;
size_t len; size_t len;
va_start(ap);
VA_COPY(ap2, ap); VA_COPY(ap2, ap);
if ((string = malloc(INIT_SZ)) == NULL) if ((string = malloc(INIT_SZ)) == NULL)
goto fail; goto fail;