Bug 178941

Summary: Memory corruption in dos2unix
Product: Red Hat Enterprise Linux 4 Reporter: H.J. Lu <hongjiu.lu>
Component: dos2unixAssignee: Tim Waugh <twaugh>
Status: CLOSED DUPLICATE QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-25 17:23:39 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
A patch none

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 ***