Commit 9fadcefd authored by Sharon Yang's avatar Sharon Yang Committed by Commit Bot

[fuchsia] Add size check for content directory handle list

Add a check to make sure the content directory handle list size doesn't
exceed the 16 bit handle-id space.

Test: web_engine_unittests
Bug: 1073176
Change-Id: I0a90f5bcca35a3c0e29e605bda9c6439092d3d29
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2283556
Commit-Queue: Sharon Yang <yangsharon@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Reviewed-by: default avatarDavid Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786062}
parent 7c92257a
......@@ -103,6 +103,8 @@ fdio_spawn_action_t FdioSpawnActionSetName(const char* name) {
uint32_t LaunchOptions::AddHandleToTransfer(
HandlesToTransferVector* handles_to_transfer,
zx_handle_t handle) {
CHECK_LE(handles_to_transfer->size(), std::numeric_limits<uint16_t>::max())
<< "Number of handles to transfer exceeds total allowed";
uint32_t handle_id = PA_HND(PA_USER1, handles_to_transfer->size());
handles_to_transfer->push_back({handle_id, handle});
return handle_id;
......
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