Bug 46288

Summary: function mono_string_to_byvalwstr may cause access violation
Product: [Mono] Runtime Reporter: ywq <ywqywq>
Component: InteropAssignee: Bugzilla <bugzilla>
Status: RESOLVED FIXED    
Severity: normal CC: miguel, mono-bugs+mono, mono-bugs+runtime
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:

Description ywq 2016-11-02 15:01:38 UTC
https://github.com/mono/mono/blob/master/mono/metadata/marshal.c#L1151

I think it may be 
    
memcpy (dst, mono_string_chars (src), len * 2);

else it my read unreadable memory at src.
Comment 1 Miguel de Icaza [MSFT] 2016-11-28 02:44:24 UTC
Pull request:

https://github.com/mono/mono/pull/4031
Comment 2 Miguel de Icaza [MSFT] 2016-12-03 02:28:12 UTC
Merged