Bug 44798 - Linker warning about tempnam
Summary: Linker warning about tempnam
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mailx
Version: 8.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Ivana Varekova
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On: 427335
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-06-16 20:59 UTC by Russell King
Modified: 2008-01-03 07:50 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-02 14:37:52 UTC
Embargoed:


Attachments (Terms of Use)

Description Russell King 2001-06-16 20:59:48 UTC
Description of Problem:
Building this package on ARM against glibc 2.2.2 reveals the following
warning:

gcc  -O2 -fsigned-char -fomit-frame-pointer -march=armv3 -D_GNU_SOURCE -o
mail version.o aux.o cmd1.o cmd2.o cmd3.o cmdtab.o collect.o no_dot_lock.o
edit.o fio.o getname.o head.o v7.local.o lex.o list.o main.o names.o
popen.o quit.o send.o strings.o temp.o tty.o vars.o flock.o
quit.o: In function `edstop':
quit.o(.text+0xb0c): the use of `tempnam' is dangerous, better use
`mkstemp'

Steps to Reproduce:
1. rpm --rebuild mailx-8.1.1-20.src.rpm

Comment 1 Phil Copeland 2001-06-24 18:51:26 UTC
Still present in mailx-8.1.1-21.src.rpm

Comment 2 Alan Cox 2002-12-18 13:35:57 UTC
Careful review indicates it always uses the names carefully via open() with the
right O_EXCL flags set. It might be better if mailx kept its scratch files
elsewhere but its not a security bug.

We should update to the newest mailx base code.


Comment 3 Ivana Varekova 2004-11-15 12:47:02 UTC
Thank you for your notices.
The problem was fixed.
IV

Comment 4 Miloslav Trmač 2004-11-17 19:53:12 UTC
Quoting mailx-8.1.1-bug44798.patch:
+tempname = (char *)malloc(sizeof(char)*(strlen(tmpdir)+10));
+strcpy(tempname, tmpdir);
+strcat(tempname, "mboxXXXXXX");

AFAICS, tempname actually uses
(strlen(tmpdir) + strlen("mboxXXXXXX") + 1) bytes, which is
(strlen(tmpdir) + 11), one more than is allocated.

Comment 5 Ivana Varekova 2004-11-18 08:09:26 UTC
This problem was fixed. 
Thank you for your correction.
IV

Comment 6 Ivana Varekova 2004-12-02 14:37:52 UTC
Solved with -40.


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