Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 05 Sep 2014 22:50:52 +0200
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: Re: New static analysis results

Am Freitag, den 05.09.2014, 14:53 -0400 schrieb Rich Felker:
> See also asctime: it's even worse, specified to be UB, via potential
> buffer overflow, if the values are outside of the expected range.
> 
> These functions really just should not be used for anything. Short of
> rolling your own, strftime is the only correct way to format time as a
> string.

the corresponding xxx_s functions from Annex K are a bit better, here.

> At some point it would be nice to make a big list of standard C
> functions that are utterly unusable due to UB on errors. Unusable due
> to lack of thread safety is another big area, too.

Annex K can basically be read as such a list (for C itself, not POSIX)
and gives replacements for them, I think.

Implementing these functions, using them with a constraint handler
that is set to ignore_handler_s, and checking for the return values of
the functions is a realistic alternative to all this UB stuff.

Jens

-- 
:: INRIA Nancy Grand Est ::: AlGorille ::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::



Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.