Initialize SHA buffer size var in passwd_abort
authorMartin Etnestad <martin.etnestad@appeartv.com>
Fri, 12 Jan 2018 08:04:38 +0000 (09:04 +0100)
committerTom Rini <trini@konsulko.com>
Sun, 28 Jan 2018 14:36:28 +0000 (09:36 -0500)
The call to hash_block in passwd_abort fails with error ENOSPC on some
systems. The reason is that the variable which specifies the size of the
buffer to contain the computed hash does not get initialized.

This patch initializes the variable with the size of the buffer.

Signed-off-by: Martin Etnestad <martin.etnestad@appeartv.com>
common/autoboot.c

index a0118650287e08e12e979dffc3367acdb8bfc01c..2eef7a04cc732fd0b250c64583cad09d77d40691 100644 (file)
@@ -57,7 +57,7 @@ static int passwd_abort(uint64_t etime)
        const char *algo_name = "sha256";
        u_int presskey_len = 0;
        int abort = 0;
-       int size;
+       int size = sizeof(sha);
        int ret;
 
        if (sha_env_str == NULL)