]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
chmod_extended and fchmod_extended: handle NULL xsecurity argument correctly.
authorJulian Seward <jseward@acm.org>
Thu, 7 Oct 2010 15:38:51 +0000 (15:38 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 7 Oct 2010 15:38:51 +0000 (15:38 +0000)
Fixes #247510.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11412

coregrind/m_syswrap/syswrap-darwin.c

index 2a929c1bb32a4da91f08abf8991ae48057a8f578..76ad8674d533bb11983b80e15700a613f34a042e 100644 (file)
@@ -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)