aboutsummaryrefslogtreecommitdiff
path: root/libmudflap/mf-hooks2.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2005-09-23 21:58:39 +0000
committerFrank Ch. Eigler <fche@gcc.gnu.org>2005-09-23 21:58:39 +0000
commit04f98580d457cb78ce7856b7626f1b0ec078281d (patch)
tree5315471d8a87565ee06e3a88c78d31e8ffdaa997 /libmudflap/mf-hooks2.c
parent337dc8ca5e81ec39f4e8528fc8d5ca52266de712 (diff)
downloadgcc-04f98580d457cb78ce7856b7626f1b0ec078281d.zip
gcc-04f98580d457cb78ce7856b7626f1b0ec078281d.tar.gz
gcc-04f98580d457cb78ce7856b7626f1b0ec078281d.tar.bz2
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
Diffstat (limited to 'libmudflap/mf-hooks2.c')
-rw-r--r--libmudflap/mf-hooks2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libmudflap/mf-hooks2.c b/libmudflap/mf-hooks2.c
index 0ffcf09..1da2261 100644
--- a/libmudflap/mf-hooks2.c
+++ b/libmudflap/mf-hooks2.c
@@ -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);
}