summaryrefslogtreecommitdiff
path: root/sshbuf-misc.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2019-07-07 01:05:00 +0000
committerDamien Miller <djm@mindrot.org>2019-07-08 11:45:51 +1000
commit696fb4298e80f2ebcd188986a91b49af3b7ca14c (patch)
treeb07d04b5035781544ddb0e9e9fee1476bf564850 /sshbuf-misc.c
parent156e9e85e92b46ca90226605d9eff49e8ec31b22 (diff)
upstream: Remove some set but never used variables. ok daraadt@
OpenBSD-Commit-ID: 824baf9c59afc66a4637017e397b9b74a41684e7
Diffstat (limited to 'sshbuf-misc.c')
-rw-r--r--sshbuf-misc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sshbuf-misc.c b/sshbuf-misc.c
index 15dcfbc79..a077a01ef 100644
--- a/sshbuf-misc.c
+++ b/sshbuf-misc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshbuf-misc.c,v 1.6 2016/05/02 08:49:03 djm Exp $ */ 1/* $OpenBSD: sshbuf-misc.c,v 1.7 2019/07/07 01:05:00 dtucker Exp $ */
2/* 2/*
3 * Copyright (c) 2011 Damien Miller 3 * Copyright (c) 2011 Damien Miller
4 * 4 *
@@ -95,14 +95,13 @@ sshbuf_dtob64(struct sshbuf *buf)
95 size_t len = sshbuf_len(buf), plen; 95 size_t len = sshbuf_len(buf), plen;
96 const u_char *p = sshbuf_ptr(buf); 96 const u_char *p = sshbuf_ptr(buf);
97 char *ret; 97 char *ret;
98 int r;
99 98
100 if (len == 0) 99 if (len == 0)
101 return strdup(""); 100 return strdup("");
102 plen = ((len + 2) / 3) * 4 + 1; 101 plen = ((len + 2) / 3) * 4 + 1;
103 if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL) 102 if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL)
104 return NULL; 103 return NULL;
105 if ((r = b64_ntop(p, len, ret, plen)) == -1) { 104 if (b64_ntop(p, len, ret, plen) == -1) {
106 explicit_bzero(ret, plen); 105 explicit_bzero(ret, plen);
107 free(ret); 106 free(ret);
108 return NULL; 107 return NULL;