Fix out of bounds write in clampedDiff in engine_derivative_fd.c
PiperOrigin-RevId: 535234007 Change-Id: I1ca54df1324346cd250409125939fdf6f63cee04
This commit is contained in:
committed by
Copybara-Service
parent
c66d79409c
commit
cce7fb04d1
@@ -122,7 +122,7 @@ static void clampedStateDiff(const mjModel* m, mjtNum* ds, const mjtNum* s, cons
|
||||
stateDiff(m, ds, s_minus, s_plus, 2*h);
|
||||
} else {
|
||||
// differencing failed, write zeros
|
||||
mju_zero(ds, m->nq + m->nv + m->na);
|
||||
mju_zero(ds, 2*m->nv + m->na);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user