]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
CID 97193: check return from sscanf() in ntp_config.c
authorHarlan Stenn <stenn@ntp.org>
Thu, 28 Jun 2012 06:43:05 +0000 (23:43 -0700)
committerHarlan Stenn <stenn@ntp.org>
Thu, 28 Jun 2012 06:43:05 +0000 (23:43 -0700)
bk: 4febfcf9RhhkQ5-pn318ac01eMuP9w

ChangeLog
ntpd/ntp_config.c

index 3c624755f331e9301fec9def429b32209b9d8d6c..943a40cb011f138f0e80fd1de5fc12015150e92e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* CID 97193: check return from sscanf() in ntp_config.c.
 * CID 709169: check return from open("/dev/null", 0) and friends.
 * CID 709207: Initialize "quality" for ulink_receive.
 (4.2.7p285) 2012/06/18 Released by Harlan Stenn <stenn@ntp.org>
index f731fb9ff06035509c5a8c787e6312f9540d58e4..caf6c5603d9aea925ed9336a4e78adc2d95f2b9e 100644 (file)
@@ -2709,9 +2709,9 @@ config_nic_rules(
                                *pchSlash = '\0';
                        if (is_ip_address(if_name, AF_UNSPEC, &addr)) {
                                match_type = MATCH_IFADDR;
-                               if (pchSlash != NULL) {
-                                       sscanf(pchSlash + 1, "%d",
-                                           &prefixlen);
+                               if (pchSlash != NULL    \
+                                   && 1 == sscanf(pchSlash + 1, "%d",
+                                           &prefixlen)) {
                                        addrbits = 8 *
                                            SIZEOF_INADDR(AF(&addr));
                                        prefixlen = max(-1, prefixlen);