From: Julian Seward Date: Thu, 7 Oct 2010 15:38:51 +0000 (+0000) Subject: chmod_extended and fchmod_extended: handle NULL xsecurity argument correctly. X-Git-Tag: svn/VALGRIND_3_6_0~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bee9b6b32149106bbde2d574edf7b629696f15e8;p=thirdparty%2Fvalgrind.git chmod_extended and fchmod_extended: handle NULL xsecurity argument correctly. Fixes #247510. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11412 --- diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 2a929c1bb3..76ad8674d5 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -2041,8 +2041,10 @@ PRE(fchmod_extended) /* DDD: relative to the xnu sources (kauth_copyinfilesec), this is just way wrong. [The trouble is with the size, which depends on a non-trival kernel computation] */ - PRE_MEM_READ( "fchmod_extended(xsecurity)", ARG5, - sizeof(struct vki_kauth_filesec) ); + if (ARG5) { + PRE_MEM_READ( "fchmod_extended(xsecurity)", ARG5, + sizeof(struct vki_kauth_filesec) ); + } } PRE(chmod_extended) @@ -2061,8 +2063,10 @@ PRE(chmod_extended) /* DDD: relative to the xnu sources (kauth_copyinfilesec), this is just way wrong. [The trouble is with the size, which depends on a non-trival kernel computation] */ - PRE_MEM_READ( "chmod_extended(xsecurity)", ARG5, - sizeof(struct vki_kauth_filesec) ); + if (ARG5) { + PRE_MEM_READ( "chmod_extended(xsecurity)", ARG5, + sizeof(struct vki_kauth_filesec) ); + } } PRE(open_extended)