WireServer: Check for ID 0 in hand-written handlers.

BUG=chromium:905272

Change-Id: Ib8efb307dbdd6fc57d2cc75366f238c4dfb2beea
Reviewed-on: https://dawn-review.googlesource.com/c/2563
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2018-11-20 09:31:45 +00:00 committed by Commit Bot service account
parent ece004fd69
commit c56860e27f
1 changed files with 10 additions and 0 deletions

View File

@ -542,6 +542,11 @@ namespace dawn_wire {
uint32_t requestStart = cmd->start;
bool isWrite = cmd->isWrite;
//* The null object isn't valid as `self`
if (bufferId == 0) {
return false;
}
auto* buffer = mKnownBuffer.Get(bufferId);
if (buffer == nullptr) {
return false;
@ -585,6 +590,11 @@ namespace dawn_wire {
ObjectId bufferId = cmd->bufferId;
size_t dataLength = cmd->dataLength;
//* The null object isn't valid as `self`
if (bufferId == 0) {
return false;
}
auto* buffer = mKnownBuffer.Get(bufferId);
if (buffer == nullptr || !buffer->valid || buffer->mappedData == nullptr ||
buffer->mappedDataSize != dataLength) {