This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/1960] New: MAX usage in io/fts.c with side effects
- From: "heiko dot nardmann at secunet dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 1 Dec 2005 16:09:50 -0000
- Subject: [Bug libc/1960] New: MAX usage in io/fts.c with side effects
- Reply-to: sourceware-bugzilla at sourceware dot org
In io/fts.c the macro MAX is used with the first argument being a function
call:
if (fts_palloc(sp, MAX(fts_maxarglen(argv), MAXPATHLEN)))
goto mem1;
This may lead to side effects. How about rewriting this with
{
size_t maxarglen = fts_maxarglen(argv);
if (fts_palloc(sp, MAX(maxarglen, MAXPATHLEN)))
goto mem1;
}
Or is the side effect intended?
A second effect is that glibc gets a little bit faster ... ;-)
--
Summary: MAX usage in io/fts.c with side effects
Product: glibc
Version: 2.3.5
Status: NEW
Severity: minor
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: heiko dot nardmann at secunet dot com
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=1960
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.