Bug 174016 - Temporary filename buffer one byte too short
Temporary filename buffer one byte too short
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dos2unix (Show other bugs)
4.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
: 178772 178941 185298 196703 (view as bug list)
Depends On:
Blocks: 187538
  Show dependency treegraph
 
Reported: 2005-11-23 12:56 EST by Peter Svensson
Modified: 2007-11-30 17:07 EST (History)
5 users (show)

See Also:
Fixed In Version: RHBA-2006-0227
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-03-22 11:42:20 EST
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 Peter Svensson 2005-11-23 12:56:31 EST
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 04:58:22 EST
*** Bug 178772 has been marked as a duplicate of this bug. ***
Comment 5 Tim Waugh 2006-01-25 12:23:48 EST
*** Bug 178941 has been marked as a duplicate of this bug. ***
Comment 9 Tim Waugh 2006-03-13 09:32:18 EST
*** Bug 185298 has been marked as a duplicate of this bug. ***
Comment 12 Red Hat Bugzilla 2006-03-22 11:42:20 EST
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 11:58:04 EDT
*** 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.