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:
parent
ece004fd69
commit
c56860e27f
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue