[netcore] Fix NULL dereference when running LLVM JIT
authorFilip Navara <navara@emclient.com>
Tue, 8 Oct 2019 21:37:34 +0000 (23:37 +0200)
committerMarek Safar <marek.safar@gmail.com>
Wed, 9 Oct 2019 06:39:22 +0000 (08:39 +0200)
Commit migrated from https://github.com/mono/mono/commit/28b3446d9eb433a23b595996d4a32dcea5f46b14

src/mono/mono/utils/mono-dl.c

index 6254b64..c3a3159 100644 (file)
@@ -152,7 +152,7 @@ get_dl_name_from_libtool (const char *libtool_file)
 static const char *
 fix_libc_name (const char *name)
 {
-       if (strcmp (name, "libc") == 0) {
+       if (name != NULL && strcmp (name, "libc") == 0) {
                // Taken from CoreCLR: https://github.com/dotnet/coreclr/blob/6b0dab793260d36e35d66c82678c63046828d01b/src/pal/src/loader/module.cpp#L568-L576
 #if defined (HOST_DARWIN)
                return "/usr/lib/libc.dylib";