summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2021-01-31 10:50:10 +0000
committerdtucker <dtucker@openbsd.org>2021-01-31 10:50:10 +0000
commita0f6d93f76aea7dc47d1c082382b4f998c75495c (patch)
tree251650ae7312d986abaf9bbaaf2791d6e9c3f3f5 /usr.bin/ssh
parentlast pieces of satisfying -fno-common (diff)
downloadwireguard-openbsd-a0f6d93f76aea7dc47d1c082382b4f998c75495c.tar.xz
wireguard-openbsd-a0f6d93f76aea7dc47d1c082382b4f998c75495c.zip
Set linesize returned by getline to zero when freeing and NULLing the
returned string. OpenBSD's getline handles this just fine, but some implementations used by -portable do not. ok djm@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/sshsig.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshsig.c b/usr.bin/ssh/sshsig.c
index 2638253958e..58ad4c2643f 100644
--- a/usr.bin/ssh/sshsig.c
+++ b/usr.bin/ssh/sshsig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshsig.c,v 1.19 2021/01/26 00:49:30 djm Exp $ */
+/* $OpenBSD: sshsig.c,v 1.20 2021/01/31 10:50:10 dtucker Exp $ */
/*
* Copyright (c) 2019 Google LLC
*
@@ -851,6 +851,7 @@ sshsig_check_allowed_keys(const char *path, const struct sshkey *sign_key,
principal, sig_namespace);
free(line);
line = NULL;
+ linesize = 0;
if (r == SSH_ERR_KEY_NOT_FOUND)
continue;
else if (r == 0) {
@@ -996,6 +997,7 @@ sshsig_find_principals(const char *path, const struct sshkey *sign_key,
sign_key, principals);
free(line);
line = NULL;
+ linesize = 0;
if (r == SSH_ERR_KEY_NOT_FOUND)
continue;
else if (r == 0) {