From 696fb4298e80f2ebcd188986a91b49af3b7ca14c Mon Sep 17 00:00:00 2001 From: "dtucker@openbsd.org" Date: Sun, 7 Jul 2019 01:05:00 +0000 Subject: [PATCH] upstream: Remove some set but never used variables. ok daraadt@ OpenBSD-Commit-ID: 824baf9c59afc66a4637017e397b9b74a41684e7 --- channels.c | 5 ++--- hostfile.c | 5 ++--- sshbuf-misc.c | 5 ++--- sshconnect2.c | 9 ++++----- sshkey.c | 6 ++---- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/channels.c b/channels.c index e1c7be81f..47521d3e7 100644 --- a/channels.c +++ b/channels.c @@ -1,4 +1,4 @@ -/* $OpenBSD: channels.c,v 1.393 2019/06/28 13:35:04 deraadt Exp $ */ +/* $OpenBSD: channels.c,v 1.394 2019/07/07 01:05:00 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -3277,7 +3277,6 @@ channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh) int id = channel_parse_id(ssh, __func__, "status confirm"); Channel *c; struct channel_confirm *cc; - int r; /* Reset keepalive timeout */ ssh_packet_set_alive_timeouts(ssh, 0); @@ -3290,7 +3289,7 @@ channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh) } if (channel_proxy_upstream(c, type, seq, ssh)) return 0; - if ((r = sshpkt_get_end(ssh)) != 0) + if (sshpkt_get_end(ssh) != 0) ssh_packet_disconnect(ssh, "Invalid status confirm message"); if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL) return 0; diff --git a/hostfile.c b/hostfile.c index 6a2a3d0b0..389aae1fc 100644 --- a/hostfile.c +++ b/hostfile.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hostfile.c,v 1.75 2019/06/28 01:23:50 deraadt Exp $ */ +/* $OpenBSD: hostfile.c,v 1.76 2019/07/07 01:05:00 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -163,13 +163,12 @@ int hostfile_read_key(char **cpp, u_int *bitsp, struct sshkey *ret) { char *cp; - int r; /* Skip leading whitespace. */ for (cp = *cpp; *cp == ' ' || *cp == '\t'; cp++) ; - if ((r = sshkey_read(ret, &cp)) != 0) + if (sshkey_read(ret, &cp) != 0) return 0; /* Skip trailing whitespace. */ 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 @@ -/* $OpenBSD: sshbuf-misc.c,v 1.6 2016/05/02 08:49:03 djm Exp $ */ +/* $OpenBSD: sshbuf-misc.c,v 1.7 2019/07/07 01:05:00 dtucker Exp $ */ /* * Copyright (c) 2011 Damien Miller * @@ -95,14 +95,13 @@ sshbuf_dtob64(struct sshbuf *buf) size_t len = sshbuf_len(buf), plen; const u_char *p = sshbuf_ptr(buf); char *ret; - int r; if (len == 0) return strdup(""); plen = ((len + 2) / 3) * 4 + 1; if (SIZE_MAX / 2 <= len || (ret = malloc(plen)) == NULL) return NULL; - if ((r = b64_ntop(p, len, ret, plen)) == -1) { + if (b64_ntop(p, len, ret, plen) == -1) { explicit_bzero(ret, plen); free(ret); return NULL; diff --git a/sshconnect2.c b/sshconnect2.c index 0ad44ce19..cb8d2193d 100644 --- a/sshconnect2.c +++ b/sshconnect2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshconnect2.c,v 1.306 2019/06/28 13:35:04 deraadt Exp $ */ +/* $OpenBSD: sshconnect2.c,v 1.307 2019/07/07 01:05:00 dtucker Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. * Copyright (c) 2008 Damien Miller. All rights reserved. @@ -570,14 +570,13 @@ input_userauth_failure(int type, u_int32_t seq, struct ssh *ssh) Authctxt *authctxt = ssh->authctxt; char *authlist = NULL; u_char partial; - int r; if (authctxt == NULL) fatal("input_userauth_failure: no authentication context"); - if ((r = sshpkt_get_cstring(ssh, &authlist, NULL)) != 0 || - (r = sshpkt_get_u8(ssh, &partial)) != 0 || - (r = sshpkt_get_end(ssh)) != 0) + if (sshpkt_get_cstring(ssh, &authlist, NULL) != 0 || + sshpkt_get_u8(ssh, &partial) != 0 || + sshpkt_get_end(ssh) != 0) goto out; if (partial != 0) { diff --git a/sshkey.c b/sshkey.c index 5d28c4577..6b5ff0485 100644 --- a/sshkey.c +++ b/sshkey.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshkey.c,v 1.78 2019/06/27 06:29:35 djm Exp $ */ +/* $OpenBSD: sshkey.c,v 1.79 2019/07/07 01:05:00 dtucker Exp $ */ /* * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. * Copyright (c) 2008 Alexander von Gernler. All rights reserved. @@ -950,7 +950,6 @@ fingerprint_b64(const char *alg, u_char *dgst_raw, size_t dgst_raw_len) char *ret; size_t plen = strlen(alg) + 1; size_t rlen = ((dgst_raw_len + 2) / 3) * 4 + plen + 1; - int r; if (dgst_raw_len > 65536 || (ret = calloc(1, rlen)) == NULL) return NULL; @@ -958,8 +957,7 @@ fingerprint_b64(const char *alg, u_char *dgst_raw, size_t dgst_raw_len) strlcat(ret, ":", rlen); if (dgst_raw_len == 0) return ret; - if ((r = b64_ntop(dgst_raw, dgst_raw_len, - ret + plen, rlen - plen)) == -1) { + if (b64_ntop(dgst_raw, dgst_raw_len, ret + plen, rlen - plen) == -1) { freezero(ret, rlen); return NULL; }