From dcb4f4808202a146588cce5d2a945ab0ba189e90 Mon Sep 17 00:00:00 2001 From: Kilian Bracher Date: Sat, 19 Oct 2024 18:56:10 +0200 Subject: [PATCH] fix buffer over-read --- Core/Src/ADBMS_Abstraction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Src/ADBMS_Abstraction.c b/Core/Src/ADBMS_Abstraction.c index 2b57a64..d27d339 100644 --- a/Core/Src/ADBMS_Abstraction.c +++ b/Core/Src/ADBMS_Abstraction.c @@ -263,7 +263,7 @@ uint8_t amsWriteComm(uint8_t device, uint8_t addr, uint8_t data) { CHECK_RETURN(writeCMD(WRCOMM, txbuf, COMM_GROUP_SIZE)); uint8_t rxbuf[6] = {0,0,0,0,0,0}; readCMD(RDCOMM, rxbuf, COMM_GROUP_SIZE); - if (rxbuf[6] != txbuf[6]) { + if (rxbuf[5] != txbuf[5]) { // assert that the data was written correctly while(1){} } CHECK_RETURN(writeCMD_I2C(STCOMM, 72, NULL, 0));