mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 18:48:13 -07:00
CodeQL fixes for "Comparison between A of type TypeA and B of wider type TypeB"
This commit is contained in:
parent
20c4756f2a
commit
91be146ecb
6 changed files with 36 additions and 3 deletions
|
@ -364,6 +364,7 @@ static s32_t spiffs_obj_lu_scan_v(
|
|||
// Checks magic if enabled
|
||||
s32_t spiffs_obj_lu_scan(
|
||||
spiffs *fs) {
|
||||
|
||||
s32_t res;
|
||||
spiffs_block_ix bix;
|
||||
int entry;
|
||||
|
@ -371,6 +372,14 @@ s32_t spiffs_obj_lu_scan(
|
|||
spiffs_block_ix unerased_bix = (spiffs_block_ix) - 1;
|
||||
#endif
|
||||
|
||||
// this _should_ never happen, but prefer to see debug message / error
|
||||
// rather than silently entering infinite loop.
|
||||
if (fs->block_count > ((spiffs_block_ix)(-1))) {
|
||||
SPIFFS_DBG("Avoiding infinite loop, block_count "_SPIPRIbl" too large for spiffs_block_ix type\n", fs->block_count);
|
||||
SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_INTERNAL);
|
||||
}
|
||||
|
||||
|
||||
// find out erase count
|
||||
// if enabled, check magic
|
||||
bix = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue