From: dtucker@openbsd.org Date: Sun, 31 Jan 2021 10:50:10 +0000 (+0000) Subject: upstream: Set linesize returned by getline to zero when freeing and X-Git-Tag: V_8_5_P1~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a92a324a2e351fabd0ba8ef9b434d3b12d54ee3;p=thirdparty%2Fopenssh-portable.git upstream: 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@ OpenBSD-Commit-ID: 4d7bd5169d3397654247db9655cc69a9908d165c --- diff --git a/sshsig.c b/sshsig.c index 0b2203059..4ce4674cd 100644 --- 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) {