NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/57895: crypt-argon2.c: gcc says using uninitialized delta.tv_sec



>Number:         57895
>Category:       lib
>Synopsis:       crypt-argon2.c: gcc says using uninitialized delta.tv_sec
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 31 11:00:00 +0000 2024
>Originator:     Kouichi Hashikawa
>Release:        current, 10.0-RC3
>Organization:
>Environment:
>Description:
in compile current, gcc -Os says

/usr/src/lib/libcrypt/crypt-argon2.c: In function '__libcrypt_internal_estimate_argon2_params':
/usr/src/lib/libcrypt/crypt-argon2.c:210:3: error: 'delta.tv_sec' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  210 |   for (; delta.tv_sec < 1 && time < ARGON2_MAX_TIME; ++time) {
      |   ^~~
cc1: all warnings being treated as errors

I think that delta is not initialized and used in for.


crypt_private int
estimate_argon2_params(argon2_type atype, uint32_t *etime,
    uint32_t *ememory, uint32_t *ethreads)
{
...
        struct timespec tp1, tp2, delta;
...
                for (; delta.tv_sec < 1 && time < ARGON2_MAX_TIME; ++time) {
                        if (argon2_hash(time, memory, threads,


(... also, this file don't have $NetBSD: $ .)

>How-To-Repeat:
always.
>Fix:



Home | Main Index | Thread Index | Old Index