camerad: Out of bounds memory write (#23534)

* parens were totally wrong

* cleaner
old-commit-hash: 7e83d9a618
commatwo_master
George Hotz 4 years ago committed by GitHub
parent 2013e086ba
commit 58a47e25bb
  1. 2
      selfdrive/camerad/cameras/camera_qcom2.cc

@ -227,7 +227,7 @@ void sensors_init(int video0_fd, int sensor_fd, int camera_num) {
buf_desc[0].size = buf_desc[0].length = sizeof(struct cam_cmd_i2c_info) + sizeof(struct cam_cmd_probe); buf_desc[0].size = buf_desc[0].length = sizeof(struct cam_cmd_i2c_info) + sizeof(struct cam_cmd_probe);
buf_desc[0].type = CAM_CMD_BUF_LEGACY; buf_desc[0].type = CAM_CMD_BUF_LEGACY;
struct cam_cmd_i2c_info *i2c_info = (struct cam_cmd_i2c_info *)alloc_w_mmu_hdl(video0_fd, buf_desc[0].size, (uint32_t*)&buf_desc[0].mem_handle); struct cam_cmd_i2c_info *i2c_info = (struct cam_cmd_i2c_info *)alloc_w_mmu_hdl(video0_fd, buf_desc[0].size, (uint32_t*)&buf_desc[0].mem_handle);
struct cam_cmd_probe *probe = (struct cam_cmd_probe *)((uint8_t *)i2c_info) + sizeof(struct cam_cmd_i2c_info); auto probe = (struct cam_cmd_probe *)(i2c_info + 1);
switch (camera_num) { switch (camera_num) {
case 0: case 0:

Loading…
Cancel
Save