{"action":"closed","issue":{"url":"https://api.github.com/repos/dotnet/coreclr/issues/15632","repository_url":"https://api.github.com/repos/dotnet/coreclr","labels_url":"https://api.github.com/repos/dotnet/coreclr/issues/15632/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/coreclr/issues/15632/comments","events_url":"https://api.github.com/repos/dotnet/coreclr/issues/15632/events","html_url":"https://github.com/dotnet/coreclr/issues/15632","id":284386505,"number":15632,"title":"Use of delete[] inside ComCallWrapperTemplate::Cleanup() yields undefined behavior","user":{"login":"Dmitry-Me","id":1277095,"avatar_url":"https://avatars2.githubusercontent.com/u/1277095?v=4","gravatar_id":"","url":"https://api.github.com/users/Dmitry-Me","html_url":"https://github.com/Dmitry-Me","followers_url":"https://api.github.com/users/Dmitry-Me/followers","following_url":"https://api.github.com/users/Dmitry-Me/following{/other_user}","gists_url":"https://api.github.com/users/Dmitry-Me/gists{/gist_id}","starred_url":"https://api.github.com/users/Dmitry-Me/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dmitry-Me/subscriptions","organizations_url":"https://api.github.com/users/Dmitry-Me/orgs","repos_url":"https://api.github.com/users/Dmitry-Me/repos","events_url":"https://api.github.com/users/Dmitry-Me/events{/privacy}","received_events_url":"https://api.github.com/users/Dmitry-Me/received_events","type":"User","site_admin":false},"labels":[{"id":244582102,"url":"https://api.github.com/repos/dotnet/coreclr/labels/area-Interop","name":"area-Interop","color":"d4c5f9","default":false},{"id":173492976,"url":"https://api.github.com/repos/dotnet/coreclr/labels/up-for-grabs","name":"up-for-grabs","color":"009800","default":false}],"state":"closed","locked":false,"assignee":{"login":"luqunl","id":15055752,"avatar_url":"https://avatars3.githubusercontent.com/u/15055752?v=4","gravatar_id":"","url":"https://api.github.com/users/luqunl","html_url":"https://github.com/luqunl","followers_url":"https://api.github.com/users/luqunl/followers","following_url":"https://api.github.com/users/luqunl/following{/other_user}","gists_url":"https://api.github.com/users/luqunl/gists{/gist_id}","starred_url":"https://api.github.com/users/luqunl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luqunl/subscriptions","organizations_url":"https://api.github.com/users/luqunl/orgs","repos_url":"https://api.github.com/users/luqunl/repos","events_url":"https://api.github.com/users/luqunl/events{/privacy}","received_events_url":"https://api.github.com/users/luqunl/received_events","type":"User","site_admin":false},"assignees":[{"login":"luqunl","id":15055752,"avatar_url":"https://avatars3.githubusercontent.com/u/15055752?v=4","gravatar_id":"","url":"https://api.github.com/users/luqunl","html_url":"https://github.com/luqunl","followers_url":"https://api.github.com/users/luqunl/followers","following_url":"https://api.github.com/users/luqunl/following{/other_user}","gists_url":"https://api.github.com/users/luqunl/gists{/gist_id}","starred_url":"https://api.github.com/users/luqunl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/luqunl/subscriptions","organizations_url":"https://api.github.com/users/luqunl/orgs","repos_url":"https://api.github.com/users/luqunl/repos","events_url":"https://api.github.com/users/luqunl/events{/privacy}","received_events_url":"https://api.github.com/users/luqunl/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/coreclr/milestones/5","html_url":"https://github.com/dotnet/coreclr/milestone/5","labels_url":"https://api.github.com/repos/dotnet/coreclr/milestones/5/labels","id":1328081,"number":5,"title":"Future","description":"Milestone tracking issues not triaged to a planned release. Work in this milestone may happen, or may not: it is not committed.","creator":{"login":"joshfree","id":1302850,"avatar_url":"https://avatars1.githubusercontent.com/u/1302850?v=4","gravatar_id":"","url":"https://api.github.com/users/joshfree","html_url":"https://github.com/joshfree","followers_url":"https://api.github.com/users/joshfree/followers","following_url":"https://api.github.com/users/joshfree/following{/other_user}","gists_url":"https://api.github.com/users/joshfree/gists{/gist_id}","starred_url":"https://api.github.com/users/joshfree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshfree/subscriptions","organizations_url":"https://api.github.com/users/joshfree/orgs","repos_url":"https://api.github.com/users/joshfree/repos","events_url":"https://api.github.com/users/joshfree/events{/privacy}","received_events_url":"https://api.github.com/users/joshfree/received_events","type":"User","site_admin":false},"open_issues":1241,"closed_issues":1003,"state":"open","created_at":"2015-09-29T00:26:07Z","updated_at":"2018-03-01T06:26:00Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2017-12-24T23:26:58Z","updated_at":"2018-03-01T06:26:00Z","closed_at":"2018-03-01T06:26:00Z","author_association":"CONTRIBUTOR","body":"`ComCallWrapperTemplate::Cleanup()` invokes `delete[] this`. Here's how the object memory is allocated inside `ComCallWrapperTemplate::CreateTemplate()`:\r\n\r\n    pTemplate = (ComCallWrapperTemplate*)new BYTE[sizeof(ComCallWrapperTemplate) + numInterfaces * sizeof(SLOT)];\r\n\r\nWhen `delete[] this` is invoked `this` has type `ComCallWrapperTemplate*` and it's undefined behavior to use `delete[]` on a pointer which has type unrelated to the type used with `new[]`. `this` must be first cast to `BYTE*`."}}
{"actor":{"display_login":"jkotas"}}