Fix out-of-bound read in mju_combineSparseCount.

PiperOrigin-RevId: 535615505
Change-Id: I740d4f50b46ec2a1cd1a5a615fb4312f1bbebd94
This commit is contained in:
Saran Tunyasuvunakool
2023-05-26 07:43:59 -07:00
committed by Copybara-Service
parent cce7fb04d1
commit 1d79657512
3 changed files with 97 additions and 26 deletions
+6
View File
@@ -93,6 +93,12 @@ void mj_diagApprox(const mjModel* m, mjData* d);
void mj_makeImpedance(const mjModel* m, mjData* d);
//------------------------- constraint counting
// count the number of non-zeros in the sum of two sparse vectors
MJAPI int mju_combineSparseCount(int a_nnz, int b_nnz, const int* a_ind, const int* b_ind);
//---------------------------- top-level API for constraint construction ---------------------------
// main driver: call all functions above