Fix possible array overrun (#1178)

This commit is contained in:
tx_haggis 2024-02-15 23:59:45 -06:00 committed by GitHub
parent 5bfbd1eb28
commit b9c201de83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -566,8 +566,8 @@ void obd_response(uint8_t PIDmode, uint8_t requestedPIDlow, uint8_t requestedPID
outMsg.buf[1] = 0x62; // Same as query, except that 40h is added to the mode value. So:62h = custom mode
outMsg.buf[2] = requestedPIDlow; // PID code
outMsg.buf[3] = 0x77; // PID code
outMsg.buf[4] = lowByte(currentStatus.canin[requestedPIDlow]); // A
outMsg.buf[5] = highByte(currentStatus.canin[requestedPIDlow]); // B
outMsg.buf[4] = lowByte(currentStatus.canin[requestedPIDlow-1]); // A
outMsg.buf[5] = highByte(currentStatus.canin[requestedPIDlow-1]); // B
outMsg.buf[6] = 0x00; // C
outMsg.buf[7] = 0x00; // D
}