diff --git a/drivers/android/binder/process.rs b/drivers/android/binder/process.rs index 64960857bcdc..75e1c1b3e454 100644 --- a/drivers/android/binder/process.rs +++ b/drivers/android/binder/process.rs @@ -1214,10 +1214,10 @@ fn get_node_debug_info(&self, data: UserSlice) -> Result { let ptr = reader.read::()?.ptr; let mut out = BinderNodeDebugInfo::default(); - { + if let Some(start_ptr) = ptr.checked_add(1) { let inner = self.inner.lock(); // cursor_lower_bound retrieves the "key" passed or the next existing larger key - if let Some(cursor) = inner.nodes.cursor_lower_bound(&(ptr + 1)) { + if let Some(cursor) = inner.nodes.cursor_lower_bound(&start_ptr) { let (_, node) = cursor.current(); node.populate_debug_info(&mut out, &inner); }