This service will be undergoing maintenance at 20:00 UTC, 2017-04-03. It is expected to last about 30 minutes
Bug 427335 - Bug patch #44798 replaces "dangerous" code with "malfunctioning" code
Bug patch #44798 replaces "dangerous" code with "malfunctioning" code
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mailx (Show other bugs)
8
All Linux
low Severity medium
: ---
: ---
Assigned To: Ivana Varekova
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 44798
  Show dependency treegraph
 
Reported: 2008-01-03 02:48 EST by JW
Modified: 2008-01-04 05:09 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-01-04 05:09:51 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 JW 2008-01-03 02:48:01 EST
Description of problem:
Patch mailx-8.1.1-bug44798.patch which was accepted without testing in 2004
turned working code into malfunctioning code. But at least the compiler warning
about "dangerous" code disappeared!

Version-Release number of selected component (if applicable):
mailx-8.1.1-46

How reproducible:
Always

Steps to Reproduce:
1. read mailx-8.1.1-bug44798.patch
2.
3.
  
Actual results:
mail file not correctly edited

Expected results:
mail file should be correctly edited


Additional info:
The patch introduced the following:
     tempfd = mkstemp(tempname);
     obuf = Fopen(tempname, "w")
but the Fopen will always fail because mkstemp() just created the file!
So remainder of edstop() function never executes.

Obviously the patch should have replaced Fopen(tempname,..) with Fdopen(tempfd,...).

It has taken 3 years for anybody to detect this glaring error in this obviously
untested patch. That should be worth something. At least the compiler doesn't
generate error message about possibly "dangerous" code any more. Pity it doesn't
emit error messages about possible "malfunctioning" code.
Comment 1 Ivana Varekova 2008-01-04 05:09:51 EST
Thanks for your bug report. Fopen(tempname,..) command is right there (see man
3p fopen) problems are: open file descriptor tempfd which is not closed here and
mkstemp command outuput is not tested here - fixed in mailx-8.1.1-47.fc9.

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