From nobody Mon Aug 08 18:20:43 2022 X-Original-To: dev-commits-src-main@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 4M1kyz3Tq0z4Yk0f; Mon, 8 Aug 2022 18:20:43 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M1kyz32hxz3WZ4; Mon, 8 Aug 2022 18:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982843; 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=6g8i151eNi+pNPKT/+sy0wkusDMo9cxYasn51Eeyxi8=; b=K6mgp1wffsQOshxjr2iwf+UmH/EMju3UWh7HiXTXdGQiQ+L/Rfc8TrbFmwcGEB0bQFkdoM PTDet9diZmqOfplt9nu85phUq2AOMZE2HItA87qPlnK75znvtR+r6ZB4FDe+h903Y3tBIK qtANZhwHMzF6vLC6M1k/5XxdeKmMMAP4bb9bDPGmRThgiK4KycVkEmJtY7JvUcw6qNcw8I C7CRyYK0ind03aZXYMoFzJKcCN7uH30Pd04tlg8YdmfJuhC2YyJpIYjczCCLWf3kFM8cBL TLaRYszeQFOgLuoBQoDJNSliXnIBLhcv1XZw4XWcW69OrTMvavPUIUk1CmIQ+g== 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 4M1kyz28Snz11qD; Mon, 8 Aug 2022 18:20:43 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 278IKh7p037326; Mon, 8 Aug 2022 18:20:43 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 278IKhLo037325; Mon, 8 Aug 2022 18:20:43 GMT (envelope-from git) Date: Mon, 8 Aug 2022 18:20:43 GMT Message-Id: <202208081820.278IKhLo037325@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ed Maste Subject: git: 2969066f73fc - main - zlib: Fix extra field processing bug that dereferences NULL state->head. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2969066f73fc67a614144ac09b9f3f5291937fed Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659982843; 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=6g8i151eNi+pNPKT/+sy0wkusDMo9cxYasn51Eeyxi8=; b=hlnTFOOY7ecOYLn4XnqpF2zqKYPEgDwa2r0Agu0Omhmw/CO+hSUOGpZ5s+DrG9s8noY6OV dLySzk3gZfd9+dKWpt+pHcHoa+BM60k8vC1uZI8zGKDrRL8qwQLuJ1NZuW1NUr6iz3IztX eRyOdJv5/XeaZMaTBIeYoqwdk/P7ZIDKU0gPSdudq/8B2B78vcQKXIFQJOaLsVf9QPAk5w sfXSQJlzKMOpmtK6CTS9iI02OOn8DvQDvwMpeENY7V0cIYjeCw4JNkQ4ZFbP1YwJF3SbbL Lt2HeOutSZjSHFXQobWAmQsosBC/FNQ8fCBcvR/FCiQFOkImEa/sHS0pO/CQDA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659982843; a=rsa-sha256; cv=none; b=P0O2xWMXWLnbIi6Kgn4NNYRAWcbwONgzfwHvQEn9jYGuQwLhBrw5kQN7DO6YBWYLlUXH1J ZSgjhkrAURy1+E5khEq4QDLRnJHwxG2PnNBTN9PlQMKlDo3fvSUlHPL/9AnqDwHVCh72RD 2Zip5TYSEWdFie3TC8qAuoysmRCEs31zlz1WucogPyUhoNhi0Pw+71s2gqE1EgN15b9L97 jgOG8bvgPQ3a5bT3+6/uoHuzrCps/fnEmMPPmeDwGLjQBjYqz4VRPxfz6JfpzW5PbWQRH/ sqJXHu5AH+XnxKqy9mPC8iau5ZVRP/x6b0MawDmQOF+LY6rBD/FWkHtJNQbDHg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2969066f73fc67a614144ac09b9f3f5291937fed commit 2969066f73fc67a614144ac09b9f3f5291937fed Author: Mark Adler AuthorDate: 2022-08-08 17:50:09 +0000 Commit: Ed Maste CommitDate: 2022-08-08 18:19:27 +0000 zlib: Fix extra field processing bug that dereferences NULL state->head. The recent commit to fix a gzip header extra field processing bug introduced the new bug fixed here. (cherry picked from zlib commit 1eb7682f845ac9e9bf9ae35bbfb3bad5dacbd91d) --- sys/contrib/zlib/inflate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/contrib/zlib/inflate.c b/sys/contrib/zlib/inflate.c index 345366eed406..d4b4a0978656 100644 --- a/sys/contrib/zlib/inflate.c +++ b/sys/contrib/zlib/inflate.c @@ -763,10 +763,10 @@ int flush; copy = state->length; if (copy > have) copy = have; if (copy) { - len = state->head->extra_len - state->length; if (state->head != Z_NULL && state->head->extra != Z_NULL && - len < state->head->extra_max) { + (len = state->head->extra_len - state->length) < + state->head->extra_max) { zmemcpy(state->head->extra + len, next, len + copy > state->head->extra_max ? state->head->extra_max - len : copy);