Bug 16676 - Buffer overflow in msyslog.c
Buffer overflow in msyslog.c
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: xntp3 (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
:
: 16752 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-21 09:27 EDT by Jarno Huuskonen
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

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


Attachments (Terms of Use)

  None (edit)
Description Jarno Huuskonen 2000-08-21 09:27:19 EDT
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 17:12:09 EDT
ntp-4.0.99j-3 from Pinstripe beta is also affected.
Comment 2 Preston Brown 2000-08-23 11:24:21 EDT
*** Bug 16752 has been marked as a duplicate of this bug. ***
Comment 3 Jeff Johnson 2000-08-23 13:09:44 EDT
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.