From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89F8A363C5A for ; Fri, 7 Aug 2026 21:41:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786138872; cv=none; b=deSofH3XZZQTnODFhx86E/vdSAwxT8YnSbBOg6bKtdQmnYir0or0ygGaID2xpPEM6Wtx/yctHKSuKtlbs/kZ8ww1IVasy0HQs7VU/NAkeShjtEsz0ZPiCe9SILrTvmQ8wy8ZcY5+F7AhFFTI4agy2xu4cYWJ6YU8LGwkCjl3Qoc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786138872; c=relaxed/simple; bh=YzUXgwQWp80xI+/iph02kEzvJV1LEibJflRMZh4mJS8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=nRszfz8Oh03D6Zs2GVGFafXFjGUjR2u1iNm7v+2LN/sPGG3ZMrhgPANZJLWvgGU4T7OHfW7m2DlldpgcD+YfJsm7HK1YFzEgjG7WzfxHvD/Kj1JqXs69mnBx+4PnSr6z0r8WK/mvSuoIMgVjxmZGA1GbY808CxWPVu8rwQ0b8sg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=lZA41R9s; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=YKE8qese; arc=none smtp.client-ip=202.12.124.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="lZA41R9s"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YKE8qese" Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id B630C7A015F; Fri, 7 Aug 2026 17:41:09 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-01.internal (MEProxy); Fri, 07 Aug 2026 17:41:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1786138869; x=1786225269; bh=M16wGTo0lB HHMwWwncE44ohVcUVP56h3dr0wdRs3s70=; b=lZA41R9sp0FJ9b5G38U1o5jEi3 Qmsz4NlnPtfqKo7C6gQWJMonOUhdbtztV46wWNmc7Kra4dyC5Zk+RqSYky5iTQs8 EAmHfWdkirlS2Tek+bxDwwdRSB/1qDuzry5i9nc7waCpqWYI1LrV2oihtB9ZE6a6 AUoV+98id+qZrDbQQyuqnnJe6E/gWFLmzvc0hygjcS5psM/Nsq1rb1qsy3/bqD3/ WSXnrui4jbSI7okO6clkWRFxnc3Pa+1pmX3QBYRXDgnJvtR54Ly+KF71euI7o6U7 HChqD6vn+ikTtSnC/bl6pw4QkbuPEueuIgsbxOKss8Yugt9xfPQh7dg3U07A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1786138869; x=1786225269; bh=M16wGTo0lBHHMwWwnc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EavR08QfUhqJnH3vLT3zA X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 7 Aug 2026 17:41:09 -0400 (EDT) From: Junio C Hamano To: "Johannes Schindelin via GitGitGadget" Cc: git@vger.kernel.org, Patrick Steinhardt , Johannes Schindelin Subject: Re: [PATCH v2 07/12] packfile, git-zlib: widen `use_pack()` and zstream avail fields to `size_t` In-Reply-To: (Johannes Schindelin via GitGitGadget's message of "Wed, 05 Aug 2026 16:14:34 +0000") References: Date: Fri, 07 Aug 2026 14:41:08 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Johannes Schindelin via GitGitGadget" writes: > diff --git a/git-zlib.h b/git-zlib.h > index 44380e8ad3..0b24b15bd0 100644 > --- a/git-zlib.h > +++ b/git-zlib.h > @@ -5,8 +5,8 @@ > > typedef struct git_zstream { > struct z_stream_s z; > - unsigned long avail_in; > - unsigned long avail_out; > + size_t avail_in; > + size_t avail_out; > size_t total_in; > size_t total_out; > unsigned char *next_in; We have these size_t which means we can use a buffer larger than 4GB where size_t is larger than 32-bit ulong. But these are sizes of a single contiguous buffer, so I think that is why the log message mentioned that this is more of type consistency than being able to handle larger data (I do not think people feed >4GB contiguious buffer in one go in practice). - zlib_buf_cap() is still "unsigned long", and zlib_pre_call() feeds these potentially wider values to it. Is it possible that we trigger truncation before the avail_in/avail_out is compared with ZLIB_BUF_MAX in the zlib_buf_cap() function? - unpack_object_header_buffer() still takes "unsigned long" length; builtin/pack-objects.c:oe_get_size_slow() passes size_t avail to unpack_object_header_buffer(). This comes from use_pack(), so it is a relatively small value stored in wider size_t but I am unsure if your static checker would not flag for potential truncation?