re PR libmudflap/23084 (mudflap crash upon accept() with argement 2 and 3 as NULL)

2005-09-23  Frank Ch. Eigler  <fche@elastic.org>

	PR 23084.
	* mf-hooks2.c (accept): Tolerate NULL sockaddr* parameter.

From-SVN: r104588
This commit is contained in:
Frank Ch. Eigler 2005-09-23 21:58:39 +00:00 committed by Frank Ch. Eigler
parent 337dc8ca5e
commit 04f98580d4
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2005-09-23 Frank Ch. Eigler <fche@elastic.org>
PR 23084.
* mf-hooks2.c (accept): Tolerate NULL sockaddr* parameter.
2005-09-23 Frank Ch. Eigler <fche@elastic.org>
* testsuite/libmudflap.c++/pass58-frag.cxx: New test for heisenbug 19319.

View File

@ -1400,7 +1400,8 @@ WRAPPER2(int, getsockopt, int s, int level, int optname, void *optval,
WRAPPER2(int, accept, int s, struct sockaddr *addr, socklen_t *addrlen)
{
TRACE ("%s\n", __PRETTY_FUNCTION__);
MF_VALIDATE_EXTENT (addr, (size_t)*addrlen, __MF_CHECK_WRITE, "accept addr");
if (addr != NULL)
MF_VALIDATE_EXTENT (addr, (size_t)*addrlen, __MF_CHECK_WRITE, "accept addr");
return accept (s, addr, addrlen);
}