From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 480452155F for ; Tue, 19 Mar 2024 21:53:34 +0100 (CET) Received: (qmail 20102 invoked by uid 550); 19 Mar 2024 20:49:03 -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 20064 invoked from network); 19 Mar 2024 20:49:02 -0000 Date: Tue, 19 Mar 2024 20:47:00 +0000 (UTC) From: Thorsten Glaser X-X-Sender: tg@herc.mirbsd.org To: musl@lists.openwall.com In-Reply-To: <20240319173930.57b8eb30@inria.fr> Message-ID: References: <20240318213441.GH4163@brightrain.aerifal.cx> <627epdel4gidvu46u5ua2mclieqy3wwqbs7sxjgtgrsmkvn4up@ehu5ru6micnr> <20240319131833.GI4163@brightrain.aerifal.cx> <20240319154222.GK4163@brightrain.aerifal.cx> <20240319160832.GL4163@brightrain.aerifal.cx> <20240319173930.57b8eb30@inria.fr> Content-Language: de-Zsym-DE-1901-u-em-text-rg-denw-tz-utc, en-Zsym-GB-u-cu-eur-em-text-fw-mon-hc-h23-ms-metric-mu-celsius-rg-denw-tz-utc-va-posix MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Subject: Re: [musl] Potential bug in __res_msend_rc() wrt to union initialization. J=E2=82=91=E2=82=99=E2=82=9B Gustedt dixit: >seems to be to always put the biggest union member first, or to even >add an artificial first one `char [size-of-the-union] __dummy;`, such >that this is always 0-byte initialized if there is any initialization But then you can just memset the union and then initialise any known pointer members to NULL/nullptr manually afterwards in the union=E2=80=99s member you actually need. (IIRC, POSIX actively specifies the possible pointer members in these structs for that reason.) bye, //mirabilos --=20 15:41=E2=8E=9C Somebody write a testsuite for hello= world :-)