diff options
author | dtucker@openbsd.org <dtucker@openbsd.org> | 2019-07-07 01:05:00 +0000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-07-08 11:45:51 +1000 |
commit | 696fb4298e80f2ebcd188986a91b49af3b7ca14c (patch) | |
tree | b07d04b5035781544ddb0e9e9fee1476bf564850 | |
parent | 156e9e85e92b46ca90226605d9eff49e8ec31b22 (diff) |
upstream: Remove some set but never used variables. ok daraadt@
OpenBSD-Commit-ID: 824baf9c59afc66a4637017e397b9b74a41684e7
-rw-r--r-- | channels.c | 5 | ||||
-rw-r--r-- | hostfile.c | 5 | ||||
-rw-r--r-- | sshbuf-misc.c | 5 | ||||
-rw-r--r-- | sshconnect2.c | 9 | ||||
-rw-r--r-- | 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 @@ | |||
1 | /* $OpenBSD: channels.c,v 1.393 2019/06/28 13:35:04 deraadt Exp $ */ | 1 | /* $OpenBSD: channels.c,v 1.394 2019/07/07 01:05:00 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -3277,7 +3277,6 @@ channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh) | |||
3277 | int id = channel_parse_id(ssh, __func__, "status confirm"); | 3277 | int id = channel_parse_id(ssh, __func__, "status confirm"); |
3278 | Channel *c; | 3278 | Channel *c; |
3279 | struct channel_confirm *cc; | 3279 | struct channel_confirm *cc; |
3280 | int r; | ||
3281 | 3280 | ||
3282 | /* Reset keepalive timeout */ | 3281 | /* Reset keepalive timeout */ |
3283 | ssh_packet_set_alive_timeouts(ssh, 0); | 3282 | ssh_packet_set_alive_timeouts(ssh, 0); |
@@ -3290,7 +3289,7 @@ channel_input_status_confirm(int type, u_int32_t seq, struct ssh *ssh) | |||
3290 | } | 3289 | } |
3291 | if (channel_proxy_upstream(c, type, seq, ssh)) | 3290 | if (channel_proxy_upstream(c, type, seq, ssh)) |
3292 | return 0; | 3291 | return 0; |
3293 | if ((r = sshpkt_get_end(ssh)) != 0) | 3292 | if (sshpkt_get_end(ssh) != 0) |
3294 | ssh_packet_disconnect(ssh, "Invalid status confirm message"); | 3293 | ssh_packet_disconnect(ssh, "Invalid status confirm message"); |
3295 | if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL) | 3294 | if ((cc = TAILQ_FIRST(&c->status_confirms)) == NULL) |
3296 | return 0; | 3295 | return 0; |
diff --git a/hostfile.c b/hostfile.c index 6a2a3d0b0..389aae1fc 100644 --- a/hostfile.c +++ b/hostfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: hostfile.c,v 1.75 2019/06/28 01:23:50 deraadt Exp $ */ | 1 | /* $OpenBSD: hostfile.c,v 1.76 2019/07/07 01:05:00 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -163,13 +163,12 @@ int | |||
163 | hostfile_read_key(char **cpp, u_int *bitsp, struct sshkey *ret) | 163 | hostfile_read_key(char **cpp, u_int *bitsp, struct sshkey *ret) |
164 | { | 164 | { |
165 | char *cp; | 165 | char *cp; |
166 | int r; | ||
167 | 166 | ||
168 | /* Skip leading whitespace. */ | 167 | /* Skip leading whitespace. */ |
169 | for (cp = *cpp; *cp == ' ' || *cp == '\t'; cp++) | 168 | for (cp = *cpp; *cp == ' ' || *cp == '\t'; cp++) |
170 | ; | 169 | ; |
171 | 170 | ||
172 | if ((r = sshkey_read(ret, &cp)) != 0) | 171 | if (sshkey_read(ret, &cp) != 0) |
173 | return 0; | 172 | return 0; |
174 | 173 | ||
175 | /* Skip trailing whitespace. */ | 174 | /* 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 @@ | |||
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; |
diff --git a/sshconnect2.c b/sshconnect2.c index 0ad44ce19..cb8d2193d 100644 --- a/sshconnect2.c +++ b/sshconnect2.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshconnect2.c,v 1.306 2019/06/28 13:35:04 deraadt Exp $ */ | 1 | /* $OpenBSD: sshconnect2.c,v 1.307 2019/07/07 01:05:00 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2008 Damien Miller. All rights reserved. | 4 | * Copyright (c) 2008 Damien Miller. All rights reserved. |
@@ -570,14 +570,13 @@ input_userauth_failure(int type, u_int32_t seq, struct ssh *ssh) | |||
570 | Authctxt *authctxt = ssh->authctxt; | 570 | Authctxt *authctxt = ssh->authctxt; |
571 | char *authlist = NULL; | 571 | char *authlist = NULL; |
572 | u_char partial; | 572 | u_char partial; |
573 | int r; | ||
574 | 573 | ||
575 | if (authctxt == NULL) | 574 | if (authctxt == NULL) |
576 | fatal("input_userauth_failure: no authentication context"); | 575 | fatal("input_userauth_failure: no authentication context"); |
577 | 576 | ||
578 | if ((r = sshpkt_get_cstring(ssh, &authlist, NULL)) != 0 || | 577 | if (sshpkt_get_cstring(ssh, &authlist, NULL) != 0 || |
579 | (r = sshpkt_get_u8(ssh, &partial)) != 0 || | 578 | sshpkt_get_u8(ssh, &partial) != 0 || |
580 | (r = sshpkt_get_end(ssh)) != 0) | 579 | sshpkt_get_end(ssh) != 0) |
581 | goto out; | 580 | goto out; |
582 | 581 | ||
583 | if (partial != 0) { | 582 | if (partial != 0) { |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshkey.c,v 1.78 2019/06/27 06:29:35 djm Exp $ */ | 1 | /* $OpenBSD: sshkey.c,v 1.79 2019/07/07 01:05:00 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2008 Alexander von Gernler. All rights reserved. | 4 | * 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) | |||
950 | char *ret; | 950 | char *ret; |
951 | size_t plen = strlen(alg) + 1; | 951 | size_t plen = strlen(alg) + 1; |
952 | size_t rlen = ((dgst_raw_len + 2) / 3) * 4 + plen + 1; | 952 | size_t rlen = ((dgst_raw_len + 2) / 3) * 4 + plen + 1; |
953 | int r; | ||
954 | 953 | ||
955 | if (dgst_raw_len > 65536 || (ret = calloc(1, rlen)) == NULL) | 954 | if (dgst_raw_len > 65536 || (ret = calloc(1, rlen)) == NULL) |
956 | return NULL; | 955 | return NULL; |
@@ -958,8 +957,7 @@ fingerprint_b64(const char *alg, u_char *dgst_raw, size_t dgst_raw_len) | |||
958 | strlcat(ret, ":", rlen); | 957 | strlcat(ret, ":", rlen); |
959 | if (dgst_raw_len == 0) | 958 | if (dgst_raw_len == 0) |
960 | return ret; | 959 | return ret; |
961 | if ((r = b64_ntop(dgst_raw, dgst_raw_len, | 960 | if (b64_ntop(dgst_raw, dgst_raw_len, ret + plen, rlen - plen) == -1) { |
962 | ret + plen, rlen - plen)) == -1) { | ||
963 | freezero(ret, rlen); | 961 | freezero(ret, rlen); |
964 | return NULL; | 962 | return NULL; |
965 | } | 963 | } |