Bug 23084 - mudflap crash upon accept() with argement 2 and 3 as NULL
Summary: mudflap crash upon accept() with argement 2 and 3 as NULL
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libmudflap (show other bugs)
Version: 4.0.1
: P2 normal
Target Milestone: 4.1.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-26 18:52 UTC by Bram Matthys
Modified: 2006-01-01 20:54 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-08-02 23:55:33


Attachments
C program to reproduce this mudflap bug (475 bytes, text/plain)
2005-07-26 18:53 UTC, Bram Matthys
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bram Matthys 2005-07-26 18:52:07 UTC
Mudflap crashes when it sees an accept in the form of:
accept(lsock, NULL, NULL)
and does not crash upon:
accept(lsock, &addr, &len);

The former case is - AFAIK - legal, quoting from the accept() manpage:
'When addr is NULL nothing is filled in.'

Attached is a minimal C program to reproduce this bug.

I tried this both on 4.0.0 and 4.0.1.
Comment 1 Bram Matthys 2005-07-26 18:53:34 UTC
Created attachment 9369 [details]
C program to reproduce this mudflap bug

Compiled with:
gcc -o mudflaptest mudflaptest.c -Wall -fmudflap -lmudflap
Comment 2 Andrew Pinski 2005-07-26 18:56:10 UTC
Confirmed by looking at the source.
Comment 3 Frank Ch. Eigler 2005-09-23 21:58:26 UTC
patch committed
Comment 4 GCC Commits 2005-09-23 21:58:53 UTC
Subject: Bug 23084

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	fche@gcc.gnu.org	2005-09-23 21:58:42

Modified files:
	libmudflap     : ChangeLog mf-hooks2.c 

Log message:
	2005-09-23  Frank Ch. Eigler  <fche@elastic.org>
	
	PR 23084.
	* mf-hooks2.c (accept): Tolerate NULL sockaddr* parameter.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libmudflap/ChangeLog.diff?cvsroot=gcc&r1=1.72&r2=1.73
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libmudflap/mf-hooks2.c.diff?cvsroot=gcc&r1=1.14&r2=1.15