[Git][NTPsec/ntpsec][master] Ensure that all members of a command-line configuration block are zeroed.
Eric S. Raymond
gitlab at mg.gitlab.com
Thu Aug 31 16:26:37 UTC 2017
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
ff3b74d6 by Eric S. Raymond at 2017-08-31T12:22:31-04:00
Ensure that all members of a command-line configuration block are zeroed.
- - - - -
1 changed file:
- ntpd/ntp_config.c
Changes:
=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -2644,14 +2644,15 @@ config_peers(
/* add servers named on the command line with iburst implied */
for ( ; cmdline_server_count > 0;
cmdline_server_count--, cmdline_servers++) {
- struct peer_ctl client_ctl = {
- .version = NTP_VERSION,
- .minpoll = NTP_MINDPOLL,
- .maxpoll = NTP_MAXPOLL_UNK,
- .flags = FLAG_IBURST,
- .ttl = 0,
- .peerkey = 0,
- };
+ struct peer_ctl client_ctl;
+ /* so any new members we introduce will be zeroed */
+ memset(&client_ctl, '\0', sizeof(struct peer_ctl));
+ client_ctl.version = NTP_VERSION,
+ client_ctl.minpoll = NTP_MINDPOLL,
+ client_ctl.maxpoll = NTP_MAXPOLL_UNK,
+ client_ctl.flags = FLAG_IBURST,
+ client_ctl.ttl = 0,
+ client_ctl.peerkey = 0,
ZERO_SOCK(&peeraddr);
/*
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ff3b74d6e8c20b9c7dc74533941fe1fdef9299cb
---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/ff3b74d6e8c20b9c7dc74533941fe1fdef9299cb
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/20170831/07b9ac39/attachment.html>
More information about the vc
mailing list