Skip to content

Commit

Permalink
maptree.c: fix Untrusted loop bound (CID 1174469)
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed May 23, 2021
1 parent b4f5819 commit aeae5da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions maptree.c
Expand Up @@ -520,6 +520,8 @@ static void searchDiskTreeNode(SHPTreeHandle disktree, rectObj aoi, ms_bitarray
if( fread( &numsubnodes, 4, 1, disktree->fp ) != 1 )
goto error;
if ( disktree->needswap ) SwapWord ( 4, &numsubnodes );
if( numsubnodes < 0 || numsubnodes > INT_MAX / 4 )
goto error;

for(i=0; i<numsubnodes; i++)
searchDiskTreeNode(disktree, aoi, status);
Expand Down

0 comments on commit aeae5da

Please sign in to comment.