summaryrefslogtreecommitdiff
path: root/src/lib/openjpip/jpip_parser.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2016-09-21 13:17:09 +0200
committerMatthieu Darbois <mayeut@users.noreply.github.com>2016-09-21 13:17:09 +0200
commit045aa4d9f297b8d3d5f89e9983a54252d103a3da (patch)
treed0d0957fac1390e0d070b7037e5beaf7fdb45c82 /src/lib/openjpip/jpip_parser.c
parentda940424816e11d624362ce080bc026adffa26e8 (diff)
Fix potential out-of-bounds read (coverity) (#844)
* query_parser: Fix potential out-of-bounds read (coverity) CID 1190207 (#1 of 1): Out-of-bounds read (OVERRUN) Variable i must be checked before testing query_param.box_type. Signed-off-by: Stefan Weil <sw@weilnetz.de> * jpip_parser: Fix potential out-of-bounds read (coverity) CID 1190206 (#1 of 1): Out-of-bounds read (OVERRUN) Variable i must be checked before testing query_param.box_type. Signed-off-by: Stefan Weil <sw@weilnetz.de>
Diffstat (limited to 'src/lib/openjpip/jpip_parser.c')
-rw-r--r--src/lib/openjpip/jpip_parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/openjpip/jpip_parser.c b/src/lib/openjpip/jpip_parser.c
index d44c84c8..db0408e6 100644
--- a/src/lib/openjpip/jpip_parser.c
+++ b/src/lib/openjpip/jpip_parser.c
@@ -438,7 +438,7 @@ void enqueue_allprecincts( int tile_id, int level, int lastcomp, OPJ_BOOL *comps
OPJ_BOOL enqueue_metabins( query_param_t query_param, metadatalist_param_t *metadatalist, msgqueue_param_t *msgqueue)
{
int i;
- for( i=0; query_param.box_type[i][0]!=0 && i<MAX_NUMOFBOX; i++){
+ for( i=0; i<MAX_NUMOFBOX && query_param.box_type[i][0]!=0; i++){
if( query_param.box_type[i][0] == '*'){
fprintf( FCGI_stdout, "Status: 501\r\n");
fprintf( FCGI_stdout, "Reason: metareq with all box-property * not implemented\r\n");