Bug 178941 - Memory corruption in dos2unix
Summary: Memory corruption in dos2unix
Keywords:
Status: CLOSED DUPLICATE of bug 174016
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dos2unix
Version: 4.0
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: 2006-01-25 17:02 UTC by H.J. Lu
Modified: 2007-11-30 22:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-01-25 17:23:39 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
A patch (453 bytes, patch)
2006-01-25 17:02 UTC, H.J. Lu
no flags Details | Diff

Description H.J. Lu 2006-01-25 17:02:17 UTC
dos2unix has

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

It forgot the trailing '\0' when mallocing memory. I am attaching a patch.

Comment 1 H.J. Lu 2006-01-25 17:02:17 UTC
Created attachment 123680 [details]
A patch

Comment 2 Tim Waugh 2006-01-25 17:23:39 UTC
Changed product to 'Red Hat Enterprise Linux' (from '... Beta').

Marked as duplicate.

*** This bug has been marked as a duplicate of 174016 ***


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