Bug 152397 - dos2unix crashes on linux/alpha
Summary: dos2unix crashes on linux/alpha
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: dos2unix
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-29 08:25 UTC by Sergey Tikhonov
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 3.1-24
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-08-02 16:57:18 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Sergey Tikhonov 2005-03-29 08:25:45 UTC
Description of problem:
dos2unix command crashes on linux/alpha during compiling of Pyrex package

The problem is in dos2unix-3.1-tmppath.patch.
The function "MakeTempFileFrom" allocates memory for temporary file name
short by 1 byte and sprintf puts zero byte into non-allocated memory:

+  fname_len = strlen(dir) + strlen("/d2utmpXXXXXX");
+  if (!(fname_str = malloc(fname_len)))
+    goto make_failed;
+  sprintf(fname_str, "%s%s", dir, "/d2utmpXXXXXX");

I increased allocation by one byte ( malloc(fname_len+1) ) and problem
went away.


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

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Sitsofe Wheeler 2005-05-30 18:49:01 UTC
Sounds like a dup of bug #150277


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