diff options
Diffstat (limited to 'sshbuf-getput-basic.c')
-rw-r--r-- | sshbuf-getput-basic.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sshbuf-getput-basic.c b/sshbuf-getput-basic.c index 23e0fd7c1..74c49be7c 100644 --- a/sshbuf-getput-basic.c +++ b/sshbuf-getput-basic.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshbuf-getput-basic.c,v 1.5 2015/10/20 23:24:25 mmcc Exp $ */ | 1 | /* $OpenBSD: sshbuf-getput-basic.c,v 1.6 2016/06/16 11:00:17 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2011 Damien Miller | 3 | * Copyright (c) 2011 Damien Miller |
4 | * | 4 | * |
@@ -19,6 +19,8 @@ | |||
19 | #include "includes.h" | 19 | #include "includes.h" |
20 | 20 | ||
21 | #include <sys/types.h> | 21 | #include <sys/types.h> |
22 | |||
23 | #include <stdarg.h> | ||
22 | #include <stdlib.h> | 24 | #include <stdlib.h> |
23 | #include <stdio.h> | 25 | #include <stdio.h> |
24 | #include <string.h> | 26 | #include <string.h> |
@@ -268,7 +270,7 @@ sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap) | |||
268 | int r, len; | 270 | int r, len; |
269 | u_char *p; | 271 | u_char *p; |
270 | 272 | ||
271 | va_copy(ap2, ap); | 273 | VA_COPY(ap2, ap); |
272 | if ((len = vsnprintf(NULL, 0, fmt, ap2)) < 0) { | 274 | if ((len = vsnprintf(NULL, 0, fmt, ap2)) < 0) { |
273 | r = SSH_ERR_INVALID_ARGUMENT; | 275 | r = SSH_ERR_INVALID_ARGUMENT; |
274 | goto out; | 276 | goto out; |
@@ -278,7 +280,7 @@ sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap) | |||
278 | goto out; /* Nothing to do */ | 280 | goto out; /* Nothing to do */ |
279 | } | 281 | } |
280 | va_end(ap2); | 282 | va_end(ap2); |
281 | va_copy(ap2, ap); | 283 | VA_COPY(ap2, ap); |
282 | if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0) | 284 | if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0) |
283 | goto out; | 285 | goto out; |
284 | if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) { | 286 | if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) { |