← Commit list

6da994735

Denys Vlasenko
Denys Vlasenko
2022-04-27
SUCCESS Duration: 154s

Subject

seedrng: remove unnecessary zero-filling of local variables

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

util-linux/seedrng.c+5 -5
@@ -103,16 +103,16 @@ static int seed_rng(uint8_t *seed, size_t len, bool credit)
int entropy_count;
int buf_size;
uint8_t buffer[MAX_SEED_LEN];
- } req = {
- .entropy_count = credit ? len * 8 : 0,
- .buf_size = len
- };
+ } req;
int random_fd, ret;
if (len > sizeof(req.buffer)) {
errno = EFBIG;
return -1;
}
+
+ req.entropy_count = credit ? len * 8 : 0;
+ req.buf_size = len;
memcpy(req.buffer, seed, len);
random_fd = open("/dev/urandom", O_RDONLY);
@@ -164,7 +164,7 @@ int seedrng_main(int argc UNUSED_PARAM, char *argv[])
uint8_t new_seed[MAX_SEED_LEN];
size_t new_seed_len;
bool new_seed_creditable, skip_credit = false;
- struct timespec timestamp = { 0 };
+ struct timespec timestamp;
sha256_ctx_t hash;
enum {