Bug 152397 - dos2unix crashes on linux/alpha
dos2unix crashes on linux/alpha
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: dos2unix (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-03-29 03:25 EST by Sergey Tikhonov
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version: 3.1-24
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-08-02 12:57:18 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 Sergey Tikhonov 2005-03-29 03:25:45 EST
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 14:49:01 EDT
Sounds like a dup of bug #150277

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