Fix possible array overrun (#1178)
This commit is contained in:
parent
5bfbd1eb28
commit
b9c201de83
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue