This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 3e870475635be407b665056dfc46a5c0b95c99e9
Author: Magdalena Kasenberg <magdalena.kasenb...@codecoup.pl>
AuthorDate: Thu Feb 25 15:47:18 2021 +0100

    sensors/bno055: Fix out-of-bounds write
    
    Fix overrunning array offsetdata with index 11.
    Coverity issue 206472.
---
 hw/drivers/sensors/bno055/src/bno055_shell.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/drivers/sensors/bno055/src/bno055_shell.c 
b/hw/drivers/sensors/bno055/src/bno055_shell.c
index ec62576..6e62255 100644
--- a/hw/drivers/sensors/bno055/src/bno055_shell.c
+++ b/hw/drivers/sensors/bno055/src/bno055_shell.c
@@ -150,7 +150,7 @@ bno055_shell_cmd_sensor_offsets(int argc, char **argv)
             }
             offsetdata[i] = val;
             tok = strtok(0, ":");
-        } while(i++ < 11 && tok);
+        } while(++i < 11 && tok);
 
         bso.bso_acc_off_x  = offsetdata[0];
         bso.bso_acc_off_y  = offsetdata[1];

Reply via email to