summaryrefslogtreecommitdiffstats
path: root/contrib/ntp/libntp/findconfig.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2015-10-26 11:37:31 +0000
committerglebius <glebius@FreeBSD.org>2015-10-26 11:37:31 +0000
commit81511473d32294dc562d10f7b3e97630ccf0b64f (patch)
tree83f2b5fa5bca87e28ea638c9459aebb211698059 /contrib/ntp/libntp/findconfig.c
parenta5a01b895b5c5a5a2f92fb611161c7c0f840a76a (diff)
downloadFreeBSD-src-81511473d32294dc562d10f7b3e97630ccf0b64f.zip
FreeBSD-src-81511473d32294dc562d10f7b3e97630ccf0b64f.tar.gz
Upgrade NTP to 4.2.8p4.
Security: FreeBSD-SA-15:25.ntp Security: CVE-2015-7871 Security: CVE-2015-7855 Security: CVE-2015-7854 Security: CVE-2015-7853 Security: CVE-2015-7852 Security: CVE-2015-7851 Security: CVE-2015-7850 Security: CVE-2015-7849 Security: CVE-2015-7848 Security: CVE-2015-7701 Security: CVE-2015-7703 Security: CVE-2015-7704, CVE-2015-7705 Security: CVE-2015-7691, CVE-2015-7692, CVE-2015-7702 Approved by: so
Diffstat (limited to 'contrib/ntp/libntp/findconfig.c')
-rw-r--r--contrib/ntp/libntp/findconfig.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/contrib/ntp/libntp/findconfig.c b/contrib/ntp/libntp/findconfig.c
index ecf6a4b..1785ff7 100644
--- a/contrib/ntp/libntp/findconfig.c
+++ b/contrib/ntp/libntp/findconfig.c
@@ -22,13 +22,13 @@ FindConfig(
struct utsname unamebuf;
/* All keyed by initial target being a directory */
- (void) strcpy(result, base);
+ strlcpy(result, base, sizeof(result));
if (stat(result, &sbuf) == 0) {
if (S_ISDIR(sbuf.st_mode)) {
/* First choice is my hostname */
if (gethostname(hostname, BUFSIZ) >= 0) {
- (void) sprintf(result, "%s/%s", base, hostname);
+ snprintf(result, sizeof(result), "%s/%s", base, hostname);
if (stat(result, &sbuf) == 0) {
goto outahere;
} else {
@@ -39,17 +39,19 @@ FindConfig(
cp = unamebuf.machine + 5;
else
cp = unamebuf.machine;
- (void) sprintf(result, "%s/default.%s", base, cp);
+ snprintf(result, sizeof(result), "%s/default.%s", base, cp);
if (stat(result, &sbuf) == 0) {
goto outahere;
} else {
/* Last choice is just default */
- (void) sprintf(result, "%s/default", base);
+ snprintf(result, sizeof(result), "%s/default", base);
if (stat(result, &sbuf) == 0) {
goto outahere;
} else {
- (void) strcpy(result, "/not/found");
+ strlcpy(result,
+ "/not/found",
+ sizeof(result));
}
}
}
OpenPOWER on IntegriCloud