]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Set linesize returned by getline to zero when freeing and
authordtucker@openbsd.org <dtucker@openbsd.org>
Sun, 31 Jan 2021 10:50:10 +0000 (10:50 +0000)
committerDamien Miller <djm@mindrot.org>
Sun, 31 Jan 2021 22:57:28 +0000 (09:57 +1100)
NULLing the returned string.  OpenBSD's getline handles this just fine, but
some implementations used by -portable do not.  ok djm@

OpenBSD-Commit-ID: 4d7bd5169d3397654247db9655cc69a9908d165c

sshsig.c

index 0b2203059ce01c56ce2088eb82c3cb2a5df53430..4ce4674cd4238edf8b7247c211662beda8f081a1 100644 (file)
--- a/sshsig.c
+++ b/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
  *
@@ -853,6 +853,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) {
@@ -998,6 +999,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) {