[Git][NTPsec/ntpsec][master] Fix for issue #592 (missing check on return from stat)

Hal Murray gitlab at mg.gitlab.com
Wed Jun 19 22:03:33 UTC 2019



Hal Murray pushed to branch master at NTPsec / ntpsec


Commits:
85d4a0eb by Hal Murray at 2019-06-19T19:48:04Z
Fix for issue #592 (missing check on return from stat)

- - - - -


1 changed file:

- ntpd/nts.c


Changes:

=====================================
ntpd/nts.c
=====================================
@@ -187,7 +187,8 @@ void nts_reload_certificate(SSL_CTX *ctx) {
     if (NULL != ntsconfig.cert)
        cert = ntsconfig.cert;
 
-    stat(cert, &temp_stat);
+    if (0 != stat(cert, &temp_stat))
+      return;
 
     if ((certfile_stat.st_mtime == temp_stat.st_mtime)
             && (certfile_stat.st_ctime == temp_stat.st_ctime))
@@ -207,7 +208,7 @@ bool nts_load_certificate(SSL_CTX *ctx) {
        key = ntsconfig.key;
 
     /* for reload checking */
-    if (stat(cert, &certfile_stat))
+    if (0 != stat(cert, &certfile_stat))
         return false;
 
     if (1 != SSL_CTX_use_certificate_chain_file(ctx, cert)) {



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/85d4a0ebf21e226da089f1e8e33ffde5be71f1b2

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/85d4a0ebf21e226da089f1e8e33ffde5be71f1b2
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/20190619/39dca267/attachment.htm>


More information about the vc mailing list