Commit dbcfda52 authored by Dong Anyuan's avatar Dong Anyuan

Fix Coverity Scan CID 261543 (Overrunning array...

Fix Coverity Scan CID 261543 (Overrunning array usim_data->usim_sqn_data.sqn_ms of 6 bytes at byte offset 6 using index 6 - i (which evaluates to 6).)
parent 1e14bee4
...@@ -268,9 +268,9 @@ int usim_api_authenticate_test(usim_data_t *usim_data, ...@@ -268,9 +268,9 @@ int usim_api_authenticate_test(usim_data_t *usim_data,
printf("usim_data->usim_sqn_data.sqn_ms %p\n", usim_data->usim_sqn_data.sqn_ms); printf("usim_data->usim_sqn_data.sqn_ms %p\n", usim_data->usim_sqn_data.sqn_ms);
for (i = 0; i < USIM_API_SQNMS_SIZE; i++) { for (i = 0; i < USIM_API_SQNMS_SIZE; i++) {
//#warning "LG:BUG HERE TODO" //#warning "LG:BUG HERE TODO"
printf("i %d: ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i] %d\n",i, ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]); printf("i %d: ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - 1 - i] %d\n",i, ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - 1 - i]);
sqn_ms[USIM_API_SQNMS_SIZE - i] = sqn_ms[USIM_API_SQNMS_SIZE - 1 - i] =
((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - i]; ((uint8_t*)(usim_data->usim_sqn_data.sqn_ms))[USIM_API_SQNMS_SIZE - 1 - i];
} }
u8 sqnms[USIM_API_SQNMS_SIZE]; u8 sqnms[USIM_API_SQNMS_SIZE];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment