From nobody Wed Aug 21 10:34:17 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WpjPP4jFcz5TfBW; Wed, 21 Aug 2024 10:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WpjPP4BlRz4qYM; Wed, 21 Aug 2024 10:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724236457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/ZOesRV5e/Og8ddA0ux4H7o7lY0EqD9ZM1MGW9K6dU=; b=u0E4py185GEI4kfjV9H1I+IVateWmRQCVu0HOzcxtckw7cBpz7m2ff2+n9C599gjC98rUR cZo/o4WZpnf1ze/J0QU9kS3prdwWRwM/wQjSh200tCz5QxbH1gR1CiBSSibaAp6tIyjXdi LNqgwBHBp73vnkRr2HVFhx4Ozc9uuRbbOnqFjPs+HHD2y4U8bULXPSuSbVmYsUEVnYhEah q5JcDwW9bBJekEIorG9c2TKrzmORw/6JsXJxFMdlsdM3LZtBeZRY8yDrZmiXEx5/tAhZEJ Wb7SO3b+dtoqTH9s+gcGlZkt8iLhwkZOjxCH9GAGODGlKCWis1WzXUmjAcehfA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1724236457; a=rsa-sha256; cv=none; b=VooSvtkC92R7WnOj9M2HfDSJwBrg0f/7CFU3IIxlQuMnBcFk+04KwGBq8s7VBorY68ghML EFy3wvX+PERW4PgpNvskyyjqtJvJp3TBMq+nwHTkDe/lGvGEBvFOpgbBK+1xLfznZHSb1D nKZjqUfIEIZkXWnDpaCQfn4Yvm2t0Gj1n+81ySSi2axPBlQ3fc5gv6ElKqfS1pOPWtEFoS GL82wgqkqaEqcPoQS1PnLHXk5FQw368AeX7XOb14kU22jP1DdrX1mLAb8hdu2pgXADNmyF hxAip6MoH48gYqYgPUSCthAgGR4dzMz2mOa0EgkZo+/3ANBvPj8LOTBb6/DxdQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1724236457; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=4/ZOesRV5e/Og8ddA0ux4H7o7lY0EqD9ZM1MGW9K6dU=; b=oJOEUJGgUxCGIe9laswDaRpGTJzm1/9SYumJTab/4H4woDIDf1CxCWhaqlUtA9qfieTj+4 uXye8MTeEEm7S660tpOhijOTD/kcSiQXsauaSpcOMW+YN7suYZ70JVWvilfHZTOWLgn2Sz xAL3Z3+A/V6FseA+NNxu3zEa04Y0+GK1Gmu4lMM9OAzZ0xkaZb57iv55GMPySVw+yNNW+S +D6aYQWbz0ptVHGN8U2gGgz3pQk12b8YNoN0EmyoKADR83PRQnyfn0Vvva6OD2LE5Bn8CR Dwve8/qyTud0i7RPLV3xaBGmihqNyWjmLCkesokxRPLgnF1wPPsIHrXxraM8pA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4WpjPP3YgqzgpH; Wed, 21 Aug 2024 10:34:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 47LAYHP6078777; Wed, 21 Aug 2024 10:34:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 47LAYHLV078774; Wed, 21 Aug 2024 10:34:17 GMT (envelope-from git) Date: Wed, 21 Aug 2024 10:34:17 GMT Message-Id: <202408211034.47LAYHLV078774@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 8dfa4e5b6ce2 - stable/13 - tail -F: fix crash List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 8dfa4e5b6ce2e22ef92c0ec13aa001994774c23f Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=8dfa4e5b6ce2e22ef92c0ec13aa001994774c23f commit 8dfa4e5b6ce2e22ef92c0ec13aa001994774c23f Author: Andre Albsmeier AuthorDate: 2024-08-19 07:54:24 +0000 Commit: Konstantin Belousov CommitDate: 2024-08-21 10:34:06 +0000 tail -F: fix crash PR: 280910 (cherry picked from commit 308399a179a49b7b858c725de10177fdb0502fd2) --- usr.bin/tail/forward.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/tail/forward.c b/usr.bin/tail/forward.c index a902e006afed..2edf8730e8b1 100644 --- a/usr.bin/tail/forward.c +++ b/usr.bin/tail/forward.c @@ -382,7 +382,8 @@ follow(file_info_t *files, enum STYLE style, off_t off) sb2.st_dev != file->st.st_dev || sb2.st_nlink == 0) { show(file); - fclose(file->fp); + if (file->fp != NULL) + fclose(file->fp); file->fp = ftmp; memcpy(&file->st, &sb2, sizeof(struct stat));