aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOllivier Robert <roberto@FreeBSD.org>2009-04-19 23:34:52 +0000
committerOllivier Robert <roberto@FreeBSD.org>2009-04-19 23:34:52 +0000
commit8c0610b9602c2bdb6f856c0808ad655599ad68f6 (patch)
treef8c47f9402e462cefdcf0cc827fee1fa1acebc26
parenta3275ecc3f255ee9ae2e95324b0c6f1709699789 (diff)
downloadsrc-8c0610b9602c2bdb6f856c0808ad655599ad68f6.tar.gz
src-8c0610b9602c2bdb6f856c0808ad655599ad68f6.zip
Prevent a buffer overflow in ntpq. Patch taken from the PR database
after being committed to the official ntp tree and present in 4.2.4p7-rc2. It will be MFH to the upcoming 7.2 pending re approval. Obtained from: https://support.ntp.org/bugs/show_bug.cgi?id=1144 MFC after: 3 days Security: http://www.securityfocus.com/bid/34481 CVE-2009-0159
Notes
Notes: svn path=/vendor/ntp/dist/; revision=191298
-rw-r--r--ntpq/ntpq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c
index 91379408ff7c..4835d7e3546f 100644
--- a/ntpq/ntpq.c
+++ b/ntpq/ntpq.c
@@ -3185,9 +3185,9 @@ cookedprint(
if (!decodeuint(value, &uval))
output_raw = '?';
else {
- char b[10];
+ char b[12];
- (void) sprintf(b, "%03lo", uval);
+ (void) snprintf(b, sizeof(b), "%03lo", uval);
output(fp, name, b);
}
break;