[Git][NTPsec/ntpsec][master] ntp_random: fix two false positive uninit vars found by valgrind.
Gary E. Miller
gitlab at mg.gitlab.com
Wed Oct 17 22:19:14 UTC 2018
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
dfee955e by Gary E. Miller at 2018-10-17T22:18:00Z
ntp_random: fix two false positive uninit vars found by valgrind.
Why fix them? Because then some true positives showed their faces.
- - - - -
1 changed file:
- libntp/ntp_random.c
Changes:
=====================================
libntp/ntp_random.c
=====================================
@@ -21,7 +21,7 @@ int32_t
ntp_random(void)
{
int err;
- uint32_t rnd;
+ uint32_t rnd = 0;
err = RAND_bytes((unsigned char *)&rnd, sizeof(rnd));
if (1 != err) {
msyslog(LOG_ERR, "ERR: ntp_random - RAND_bytes failed");
@@ -34,7 +34,7 @@ uint64_t
ntp_random64(void)
{
int err;
- uint64_t rnd;
+ uint64_t rnd = 0;
err = RAND_bytes((unsigned char *)&rnd, sizeof(rnd));
if (1 != err) {
msyslog(LOG_ERR, "ERR: ntp_random - RAND_bytes failed");
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/dfee955e911332f5dbc7f34c2e3fd3d6777b3597
--
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/dfee955e911332f5dbc7f34c2e3fd3d6777b3597
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20181017/b2aad9ad/attachment-0001.html>
More information about the vc
mailing list