From: Harlan Stenn Date: Thu, 28 Jun 2012 06:43:05 +0000 (-0700) Subject: CID 97193: check return from sscanf() in ntp_config.c X-Git-Tag: NTP_4_2_7P286~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d4eae6fd286ef05fb7debe0b4216e2b8d424589c;p=thirdparty%2Fntp.git CID 97193: check return from sscanf() in ntp_config.c bk: 4febfcf9RhhkQ5-pn318ac01eMuP9w --- diff --git a/ChangeLog b/ChangeLog index 3c624755f..943a40cb0 100644 --- 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 diff --git a/ntpd/ntp_config.c b/ntpd/ntp_config.c index f731fb9ff..caf6c5603 100644 --- a/ntpd/ntp_config.c +++ b/ntpd/ntp_config.c @@ -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);