aboutsummaryrefslogtreecommitdiffstats
path: root/sshbuf-getput-basic.c
diff options
context:
space:
mode:
authorGreg Hartman <ghartman@google.com>2017-06-22 20:49:52 -0700
committerGreg Hartman <ghartman@google.com>2017-06-23 15:44:15 -0700
commit9768ca48f57aaf035f508a473421d210b5145e99 (patch)
treec2ba282fc91c65b4abbf688efbd6f09f467601da /sshbuf-getput-basic.c
parent7b5a7c1b3bb341c2ce7fa7d6386d4204680a92e4 (diff)
downloadplatform_external_openssh-9768ca48f57aaf035f508a473421d210b5145e99.tar.gz
platform_external_openssh-9768ca48f57aaf035f508a473421d210b5145e99.tar.bz2
platform_external_openssh-9768ca48f57aaf035f508a473421d210b5145e99.zip
Merge openssh 7.5p1
BUG: 35443510 Change-Id: I2558fb80234e145c13ccb7a51859f2a5fd2e0324
Diffstat (limited to 'sshbuf-getput-basic.c')
-rw-r--r--sshbuf-getput-basic.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sshbuf-getput-basic.c b/sshbuf-getput-basic.c
index 8ff8a0a2..74c49be7 100644
--- a/sshbuf-getput-basic.c
+++ b/sshbuf-getput-basic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshbuf-getput-basic.c,v 1.4 2015/01/14 15:02:39 djm Exp $ */
+/* $OpenBSD: sshbuf-getput-basic.c,v 1.6 2016/06/16 11:00:17 dtucker Exp $ */
/*
* Copyright (c) 2011 Damien Miller
*
@@ -19,6 +19,8 @@
#include "includes.h"
#include <sys/types.h>
+
+#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -131,7 +133,7 @@ sshbuf_get_string_direct(struct sshbuf *buf, const u_char **valp, size_t *lenp)
*lenp = 0;
if ((r = sshbuf_peek_string_direct(buf, &p, &len)) < 0)
return r;
- if (valp != 0)
+ if (valp != NULL)
*valp = p;
if (lenp != NULL)
*lenp = len;
@@ -168,7 +170,7 @@ sshbuf_peek_string_direct(const struct sshbuf *buf, const u_char **valp,
SSHBUF_DBG(("SSH_ERR_MESSAGE_INCOMPLETE"));
return SSH_ERR_MESSAGE_INCOMPLETE;
}
- if (valp != 0)
+ if (valp != NULL)
*valp = p + 4;
if (lenp != NULL)
*lenp = len;
@@ -268,7 +270,7 @@ sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap)
int r, len;
u_char *p;
- va_copy(ap2, ap);
+ VA_COPY(ap2, ap);
if ((len = vsnprintf(NULL, 0, fmt, ap2)) < 0) {
r = SSH_ERR_INVALID_ARGUMENT;
goto out;
@@ -278,7 +280,7 @@ sshbuf_putfv(struct sshbuf *buf, const char *fmt, va_list ap)
goto out; /* Nothing to do */
}
va_end(ap2);
- va_copy(ap2, ap);
+ VA_COPY(ap2, ap);
if ((r = sshbuf_reserve(buf, (size_t)len + 1, &p)) < 0)
goto out;
if ((r = vsnprintf((char *)p, len + 1, fmt, ap2)) != len) {
@@ -448,7 +450,7 @@ sshbuf_get_bignum2_bytes_direct(struct sshbuf *buf,
d++;
len--;
}
- if (valp != 0)
+ if (valp != NULL)
*valp = d;
if (lenp != NULL)
*lenp = len;