Bug 16676 - Buffer overflow in msyslog.c
Summary: Buffer overflow in msyslog.c
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: xntp3   
(Show other bugs)
Version: 6.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
URL:
Whiteboard:
Keywords:
: 16752 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-08-21 13:27 UTC by Jarno Huuskonen
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-23 15:54:14 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Jarno Huuskonen 2000-08-21 13:27:19 UTC
Hi !

libntp/msyslog.c has a buffer overflow error. Buffer allocated for log
messages is 1025 bytes. With longer messages you get an overflow.

For a quick test use ntpdate `perl -e "print 'A'x10000"`

Here's quick patch:
--- xntp3-5.93/libntp/msyslog.c~        Tue Aug 12 09:21:29 1997
+++ xntp3-5.93/libntp/msyslog.c Mon Aug 21 16:10:31 2000
@@ -141,7 +141,8 @@
          *n++ = '\n';
        *n = '\0';
 
-       vsprintf(buf, nfmt, ap);
+       /* Oh no ;-) */
+       vsnprintf(buf, 1024, nfmt, ap);
 #if !defined(VMS) && !defined (SYS_VXWORKS)
        if (syslogit)
 #ifndef SYS_WINNT

-Jarno

Comment 1 Pekka Savola 2000-08-22 21:12:09 UTC
ntp-4.0.99j-3 from Pinstripe beta is also affected.


Comment 2 Preston Brown 2000-08-23 15:24:21 UTC
*** Bug 16752 has been marked as a duplicate of this bug. ***

Comment 3 Jeff Johnson 2000-08-23 17:09:44 UTC
Fixed in ntp-4.0.99j-7. Thanks for the patch.


Note You need to log in before you can comment on or make changes to this bug.