shm: limit data accessed by ClientMemOffset
This commit is contained in:
parent
3f70242d32
commit
518095c7c2
7 changed files with 24 additions and 28 deletions
|
|
@ -427,10 +427,9 @@ impl Input {
|
|||
async fn handle_keymap(&self, input: JayInputId) -> Vec<u8> {
|
||||
let data = Rc::new(RefCell::new(Vec::new()));
|
||||
jay_input::Keymap::handle(&self.tc, input, data.clone(), |d, map| {
|
||||
let mem = Rc::new(
|
||||
ClientMem::new_private(&map.keymap, map.keymap_len as _, true, None, None).unwrap(),
|
||||
)
|
||||
.offset(0);
|
||||
let len = map.keymap_len as _;
|
||||
let mem = Rc::new(ClientMem::new_private(&map.keymap, len, true, None, None).unwrap())
|
||||
.offset(0, len);
|
||||
mem.read(d.borrow_mut().deref_mut()).unwrap();
|
||||
});
|
||||
self.tc.round_trip().await;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue