Commit 317fd980 authored by Ryo Hashimoto's avatar Ryo Hashimoto Committed by Commit Bot

Mojo: Check if dispatcher is null in Core::UnwrapPlatformHandle()

The same check is done in other functions in this .cc file.
Do the same thing for UnwrapPlatformHandle().

BUG=891990
TEST=mojo_unittests

Change-Id: I05fe4bfd5edd8ec3fc67aeb9f11879c74fd71dd4
Reviewed-on: https://chromium-review.googlesource.com/c/1260782Reviewed-by: default avatarKen Rockot <rockot@chromium.org>
Commit-Queue: Ryo Hashimoto <hashimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596510}
parent 7f43ff6f
......@@ -1017,7 +1017,8 @@ MojoResult Core::UnwrapPlatformHandle(
{
base::AutoLock lock(handles_->GetLock());
dispatcher = handles_->GetDispatcher(mojo_handle);
if (dispatcher->GetType() != Dispatcher::Type::PLATFORM_HANDLE)
if (!dispatcher ||
dispatcher->GetType() != Dispatcher::Type::PLATFORM_HANDLE)
return MOJO_RESULT_INVALID_ARGUMENT;
MojoResult result =
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment