git: libc/stdtime: Set errno to EOVERFLOW when there is an overflow.

Sascha Wildner swildner at crater.dragonflybsd.org
Mon May 2 18:34:29 PDT 2022


commit 56e344b830405b4e9841e03b20c5479e3d82308f
Author: Sascha Wildner <saw at online.de>
Date:   Tue May 3 03:31:11 2022 +0200

    libc/stdtime: Set errno to EOVERFLOW when there is an overflow.
    
    This fixes various issues such as gmtime() returning NULL on an
    out-of-bounds time_t but not setting errno, as POSIX requires.
    
    Also, in ctime() and ctime_r(), check the result of localtime()
    before passing it to asctime{,_r}().
    
    See:
    https://github.com/eggert/tz/commit/4d306b3a17ce5ce0b33a73a90dc713d3601ea89a

Summary of changes:
 lib/libc/stdtime/localtime.c | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/56e344b830405b4e9841e03b20c5479e3d82308f


-- 
DragonFly BSD source repository


More information about the Commits mailing list