[Git][NTPsec/ntpsec][master] Avoid a Coverity warning.

Eric S. Raymond gitlab at mg.gitlab.com
Thu Aug 17 20:46:59 UTC 2017


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
28b3a6cc by Eric S. Raymond at 2017-08-17T16:45:57-04:00
Avoid a Coverity warning.

- - - - -


1 changed file:

- ntpd/ntp_config.c


Changes:

=====================================
ntpd/ntp_config.c
=====================================
--- a/ntpd/ntp_config.c
+++ b/ntpd/ntp_config.c
@@ -3401,8 +3401,9 @@ fix_node_cidr(
         /* conversion fail, leave silently */
         return;
     }
-    if ( 0 > cidr_len ) {
-        /* negative?  leave silently */
+    if ( 0 >= cidr_len ) {
+        /* negative or zero?  leave silently */
+	/* exiting on 0 avoids a bad shift warning from Coverity */
         return;
     }
     /* sadly, addr->type not previously set, look for colon */



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/28b3a6ccc955fee5c8620cdc6889bc23aa868f76

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/28b3a6ccc955fee5c8620cdc6889bc23aa868f76
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/20170817/e69eb44a/attachment.html>


More information about the vc mailing list