Bug 67090 - cal program overflows string with wcscat()
cal program overflows string with wcscat()
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: util-linux (Show other bugs)
7.3
All Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-06-19 16:34 EDT by Everett Lipman
Modified: 2007-04-18 12:43 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-06-19 16:34:07 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 Everett Lipman 2002-06-19 16:34:01 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; SunOS 5.7 sun4u)

Description of problem:
When I attempt to run the 'cal' program with libsafe 2.0.16
linked in, I get the following output from libsafe:

Libsafe version 2.0.16
Detected an attempt to write across stack boundary.
Terminating /usr/bin/cal.
    uid=xxx  euid=xxx  pid=22338
Call stack:
    0x40016871  /lib/libsafe.so.2.0.16
    0x40016eb7  /lib/libsafe.so.2.0.16
    0x8048f14   /usr/bin/cal
    0x8048d3d   /usr/bin/cal
    0x42017494  /lib/i686/libc-2.2.5.so
Overflow caused by wcscat()
Killed

Tim Tsai from Avaya Labs (author of libsafe) writes:

This is a real bug in the cal code.  There is function called
headers_init() in the file util-linux-2.11n/misc-utils/cal.c.  The
author uses the wcscat() function without checking to make sure that
there is enough room in the destination string.




Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. Install libsafe: 
2. http://www.research.avayalabs.com/project/libsafe/
3. run cal
	

Actual Results:  See description

Expected Results:  Should have seen this month's calendar.

Additional info:
Comment 1 Elliot Lee 2002-06-20 15:00:59 EDT
2.11n-17 should have a patch to fix the problem

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