summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-asprintf.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2015-10-16 10:53:14 +1100
committerDamien Miller <djm@mindrot.org>2015-10-16 10:53:38 +1100
commit0f754e29dd3760fc0b172c1220f18b753fb0957e (patch)
tree39189d57b75b586da3fbbf8655fbf44b279a5dd6 /openbsd-compat/bsd-asprintf.c
parenteb6c50d82aa1f0d3fc95f5630ea69761e918bfcd (diff)
need va_copy before va_start
reported by Nicholas Lemonias
Diffstat (limited to 'openbsd-compat/bsd-asprintf.c')
-rw-r--r--openbsd-compat/bsd-asprintf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c
index 3368195d4..db57acce9 100644
--- a/openbsd-compat/bsd-asprintf.c
+++ b/openbsd-compat/bsd-asprintf.c
@@ -47,6 +47,7 @@ vasprintf(char **str, const char *fmt, va_list ap)
47 char *string, *newstr; 47 char *string, *newstr;
48 size_t len; 48 size_t len;
49 49
50 va_start(ap);
50 VA_COPY(ap2, ap); 51 VA_COPY(ap2, ap);
51 if ((string = malloc(INIT_SZ)) == NULL) 52 if ((string = malloc(INIT_SZ)) == NULL)
52 goto fail; 53 goto fail;