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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 1439 invoked from network); 27 Aug 2020 14:24:42 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 27 Aug 2020 14:24:42 -0000 Received: (qmail 24442 invoked by uid 550); 27 Aug 2020 14:24:36 -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 24421 invoked from network); 27 Aug 2020 14:24:36 -0000 X-IronPort-AV: E=Sophos;i="5.76,359,1592863200"; d="scan'208";a="464968026" Date: Thu, 27 Aug 2020 16:24:22 +0200 From: Jens Gustedt To: musl@lists.openwall.com Message-ID: <20200827162422.4f95f14f@inria.fr> In-Reply-To: <20200827140306.GR3265@brightrain.aerifal.cx> References: <20200823102439.2bbaffb5@inria.fr> <20200824161400.GG3265@brightrain.aerifal.cx> <20200827112759.7e04abd3@inria.fr> <20200827140306.GR3265@brightrain.aerifal.cx> Organization: inria.fr X-Mailer: Claws Mail 3.17.5git22 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAACRQTFRFERslNjAsLTE9Ok9wUk9TaUs8iWhSrYZkj42Rz6aD3sGZ MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/LH_bPAr3ZrM1TcMTm/nusuZ"; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: Re: [musl] direct coding of asctime_r --Sig_/LH_bPAr3ZrM1TcMTm/nusuZ Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable on Thu, 27 Aug 2020 10:03:07 -0400 you (Rich Felker ) wrote: > I think the behavior of crashing on inputs that are UB and that can't > safely be printed should probably be preserved, too; I'm not clear if > you had that in mind already. I'm rather indifferent on what happens > for inputs that are UB but that can faithfully be presented in the > allotted space. same for me In the sample implementation I have "goto CLEANUP" and an implicit guarantee that the output is always null terminated. This is more in the spirit of `snprintf` not to do bad things as soon the output buffer has at least 26 bytes. But we could also do `abort()`, `do_crash()`, whatever fits into musl's general strategy for error handling. Jens --=20 :: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS ::: :: ::::::::::::::: office Strasbourg : +33 368854536 :: :: :::::::::::::::::::::: gsm France : +33 651400183 :: :: ::::::::::::::: gsm international : +49 15737185122 :: :: http://icube-icps.unistra.fr/index.php/Jens_Gustedt :: --Sig_/LH_bPAr3ZrM1TcMTm/nusuZ Content-Type: application/pgp-signature Content-Description: Digitale Signatur von OpenPGP -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSN9stI2OFN1pLljN0P0+hp2tU34gUCX0fCFwAKCRAP0+hp2tU3 4h2GAKCO4BBqAMsa7Dc06PQd+KjwceT52wCfT3DLwYlc6DZxMeMmkVuH50+Uttg= =nM3g -----END PGP SIGNATURE----- --Sig_/LH_bPAr3ZrM1TcMTm/nusuZ--