forked from Archive/PX4-Autopilot
Fix maximum rotation value in GetBoardRotation()
Fix a memory overflow in case SENS_BOARD_ROT is set to Rotation::ROTATION_MAX (41) which is not a valid value Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
parent
ae70f9c640
commit
c0084ab24d
|
@ -222,7 +222,7 @@ enum Rotation GetBoardRotation()
|
|||
int32_t board_rot = -1;
|
||||
param_get(param_find("SENS_BOARD_ROT"), &board_rot);
|
||||
|
||||
if (board_rot >= 0 && board_rot <= Rotation::ROTATION_MAX) {
|
||||
if (board_rot >= 0 && board_rot < Rotation::ROTATION_MAX) {
|
||||
return static_cast<enum Rotation>(board_rot);
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue