Bug 67090 - cal program overflows string with wcscat()
Summary: cal program overflows string with wcscat()
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: util-linux
Version: 7.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elliot Lee
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-06-19 20:34 UTC by Everett Lipman
Modified: 2007-04-18 16:43 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-06-19 20:34:07 UTC
Embargoed:


Attachments (Terms of Use)

Description Everett Lipman 2002-06-19 20:34:01 UTC
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 19:00:59 UTC
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.