Bug 174016 - Temporary filename buffer one byte too short
Summary: Temporary filename buffer one byte too short
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dos2unix
Version: 4.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
: 178772 178941 185298 196703 (view as bug list)
Depends On:
Blocks: 187538
TreeView+ depends on / blocked
 
Reported: 2005-11-23 17:56 UTC by Peter Svensson
Modified: 2007-11-30 22:07 UTC (History)
5 users (show)

Fixed In Version: RHBA-2006-0227
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-22 16:42:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0227 0 normal SHIPPED_LIVE dos2unix bug fix update 2006-03-22 05:00:00 UTC

Description Peter Svensson 2005-11-23 17:56:31 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

Description of problem:
There is an off-by-one in the malloc for the temporary filename in MakeTempFileFrom(). No space is reserved for the terminating zero. This causes segfaults for some lengths of directory names.

In the unix2dos package this is already fixed.


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

How reproducible:
Always

Steps to Reproduce:
1.mkdir -p src/utils/misc/doschk/
2.touch ./src/utils/misc/doschk/README
3.dos2unix -c iso -o ./src/utils/misc/doschk/README
  

Actual Results:  dos2unix: converting file ./src/utils/misc/doschk/README to UNIX format ...
dos2unix: problems renaming './src/utils/misc/doschk/d2utmp2j4mDb' to './src/utils/misc/doschk/README'
          output file remains in './src/utils/misc/doschk/d2utmp2j4mDb'
dos2unix: problems converting file ./src/utils/misc/doschk/README

Note that the output filename ends in junk (view the output with less or similar).

Expected Results:  dos2unix: converting file ./src/utils/misc/doschk/README to UNIX format ...


Additional info:

Add 1 to the fname_len calculation in MakeTempFileFrom in dos2unix.c.

Comment 4 Tim Waugh 2006-01-24 09:58:22 UTC
*** Bug 178772 has been marked as a duplicate of this bug. ***

Comment 5 Tim Waugh 2006-01-25 17:23:48 UTC
*** Bug 178941 has been marked as a duplicate of this bug. ***

Comment 9 Tim Waugh 2006-03-13 14:32:18 UTC
*** Bug 185298 has been marked as a duplicate of this bug. ***

Comment 12 Red Hat Bugzilla 2006-03-22 16:42:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2006-0227.html


Comment 14 Tim Waugh 2006-06-26 15:58:04 UTC
*** Bug 196703 has been marked as a duplicate of this bug. ***


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