From 39f9934a70f5f01ddb7adc70801e981efb146f05 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Wed, 21 Sep 2016 13:17:09 +0200 Subject: [PATCH] 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 * 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 --- src/lib/openjpip/jpip_parser.c | 2 +- src/lib/openjpip/query_parser.c | 2 +- 2 files changed, 2 insertions(+), 2 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