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

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


commit e79614acede4320e5b550434e1236656b2ef5e01
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/e79614acede4320e5b550434e1236656b2ef5e01


-- 
DragonFly BSD source repository



More information about the Commits mailing list