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=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 13613 invoked from network); 30 Oct 2022 14:31:20 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 30 Oct 2022 14:31:20 -0000 Received: (qmail 12016 invoked by uid 550); 30 Oct 2022 14:31:16 -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 11981 invoked from network); 30 Oct 2022 14:31:15 -0000 Date: Sun, 30 Oct 2022 10:31:02 -0400 From: Rich Felker To: puwenxu Cc: "musl@lists.openwall.com" Message-ID: <20221030143101.GB29905@brightrain.aerifal.cx> References: <1903ff21f49146998d843cc2860f7166@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1903ff21f49146998d843cc2860f7166@huawei.com> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Question on 2b2c8aafce9d80f9d58652643538f4d58e82b856 On Sun, Oct 30, 2022 at 06:29:54AM +0000, puwenxu wrote: > Dear maintainer, > I'm using musl 1.2.3.0 now. When I was running some test case > codes for musl, I found there may be a problem on modification of > 2b2c8aafce9d80f9d58652643538f4d58e82b856. > As you can see in the picture, this modification assign buf > to orig. Then, the orig will be assigned to buf again. If the > original value of buf is NULL, the latter value of the buf will be > NULL. However, assign out to buf will fail if buf is NULL. Rather than pointing at what you think is wrong in the source change, can you demonstrate a minimal example of calling code that was correct and worked before the change, but fails after the change? As best I can tell, your concern is about the case where you pass a null pointer as buf when using one of the msgctl commands that requires a pointer to a buffer. This is undefined. > I have written a simple file to verification my opinion. The > test code and output is shown in the following picture. I think it > may be better to add a check for buf in this situation. This isn't an example. An example would be a minimal program that calls msgctl in a valid (i.e. no undefined behavior) way and malfunctions as a result of the change. Rich