wgpu_core::Device::buffer_map_async
doesn't bounds-check range
#2935
Labels
area: validation
Issues related to validation, diagnostics, and error handling
The
wgpu_core::Device::buffer_map_async
function doesn't bounds-checkrange
. As far as I can tell, an invalid range will get stashed inwgpu_core::resource::Buffer::map_state
, yoinked out inLifetimeTracker::handle_mapping
, and make it all the way to thewgpu_hal::Device::map_buffer
call inwgpu_core::device::map_buffer
, which is much farther than it should get.Granted,
wgpu
doesn't need that validation, since it makesmap_async
a method onBufferSlice
, whose length is already validated. But I think the checks are pretty cheap compared to everything else that's going on there, and having them inwgpu_core
would benefit all the different language bindings, and Firefox.The text was updated successfully, but these errors were encountered: