Skip to content

Commit

Permalink
Merge pull request mono#943 from Unity-Technologies/unity-trunk-avoid…
Browse files Browse the repository at this point in the history
…-crash-on-invalid-method-header

Return NULL so client can raise exception rather than asserting on invalid method header (case 1032601)
  • Loading branch information
joncham committed May 17, 2018
2 parents 6f5c66f + bff5179 commit de3cbfd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mono/metadata/loader.c
Expand Up @@ -2356,7 +2356,9 @@ mono_method_get_header (MonoMethod *method)
return NULL;

loc = mono_image_rva_map (img, rva);
g_assert (loc);
if (!loc) {
return NULL;
}

header = mono_metadata_parse_mh_full (img, mono_method_get_generic_container (method), loc);

Expand Down

0 comments on commit de3cbfd

Please sign in to comment.