未验证 提交 e8339ed2 编写于 作者: D Darren Chan 提交者: GitHub

Fix use-after-free. (#27053)

Switch from `fml::NonOwnedMapping` to `fml::DataMapping`.

All other uses of `fml::NonOwnedMapping` are not in `PlatformView` and do not access data after references are out of scope.

This fixes https://fxbug.dev/77924.
上级 6d8a01ad
......@@ -964,9 +964,8 @@ bool PlatformView::HandleFlutterPlatformViewsChannelPlatformMessage(
// The client is waiting for view creation. Send an empty response
// back to signal the view was created.
if (message->response()) {
message->response()->Complete(
std::make_unique<fml::NonOwnedMapping>((const uint8_t*)"[0]",
3u));
message->response()->Complete(std::make_unique<fml::DataMapping>(
std::vector<uint8_t>({'[', '0', ']'})));
}
});
auto on_view_bound =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册