From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13215 invoked from network); 15 May 2022 23:32:10 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 15 May 2022 23:32:10 -0000 Received: (qmail 16198 invoked by uid 550); 15 May 2022 23:32:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 16163 invoked from network); 15 May 2022 23:32:07 -0000 Date: Sun, 15 May 2022 19:31:55 -0400 From: Rich Felker To: Alyssa Ross Cc: musl@lists.openwall.com Message-ID: <20220515233154.GQ7074@brightrain.aerifal.cx> References: <20210915221155.3977763-1-hi@alyssa.is> <20210915221155.3977763-4-hi@alyssa.is> <20210920042140.GT13220@brightrain.aerifal.cx> <20220109031819.GO7074@brightrain.aerifal.cx> <878rvj1tut.fsf@alyssa.is> <20220113174037.GA7074@brightrain.aerifal.cx> <875yqn1n8g.fsf@alyssa.is> <20220512140835.GJ7074@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220512140835.GJ7074@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH musl v2 3/3] mntent: fix parsing lines with optional fields On Thu, May 12, 2022 at 10:08:37AM -0400, Rich Felker wrote: > A few other changes I think should be made: > > [...] > > - The n[] array should be changed to size_t[] and the %n's to %zn's. > This should actually be done as a separate change, as it's a fix for > a bug overlooked when 05973dc3bbc1aca9b3c8347de6879ed72147ab3b made > the buffer length potentially longer than INT_MAX. I'm going to reverse position on this: since getmntent_r only accepts an int for the line length, the thread-unsafe getmntent should not be able to process longer lines either. I'll instead just use the len you already computed to treat lines longer than INT_MAX as invalid. Rich