From: Rodrigo Kumpera Date: Wed, 5 Apr 2017 21:17:37 +0000 (-0700) Subject: [runtime] Don't return the modules for the current process when pid != getpid (). X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=ce4063f14f4b8adfd804f4127c14b7bef722a1f5;p=mono.git [runtime] Don't return the modules for the current process when pid != getpid (). --- diff --git a/mono/metadata/w32process-unix-osx.c b/mono/metadata/w32process-unix-osx.c index 9c4bdc25f7f..481d228dd20 100644 --- a/mono/metadata/w32process-unix-osx.c +++ b/mono/metadata/w32process-unix-osx.c @@ -8,6 +8,7 @@ #ifdef USE_OSX_BACKEND #include +#include #include #include #include @@ -120,9 +121,13 @@ mono_w32process_get_modules (pid_t pid) { GSList *ret = NULL; MonoW32ProcessModule *mod; - guint32 count = _dyld_image_count (); + guint32 count; int i = 0; + if (pid != getpid ()) + return NULL; + + count = _dyld_image_count (); for (i = 0; i < count; i++) { #if SIZEOF_VOID_P == 8 const struct mach_header_64 *hdr;