|
From: <sv...@va...> - 2010-10-07 15:39:01
|
Author: sewardj
Date: 2010-10-07 16:38:51 +0100 (Thu, 07 Oct 2010)
New Revision: 11412
Log:
chmod_extended and fchmod_extended: handle NULL xsecurity argument correctly.
Fixes #247510.
Modified:
trunk/coregrind/m_syswrap/syswrap-darwin.c
Modified: trunk/coregrind/m_syswrap/syswrap-darwin.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-darwin.c 2010-10-07 13:33:28 UTC (rev 11411)
+++ trunk/coregrind/m_syswrap/syswrap-darwin.c 2010-10-07 15:38:51 UTC (rev 11412)
@@ -2041,8 +2041,10 @@
/* 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 @@
/* 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)
|