Message ID | 1466993343-28996-1-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Superseded |
Headers | show |
diff --git a/test/validation/queue/queue.c b/test/validation/queue/queue.c index be9c0dc..c21897b 100644 --- a/test/validation/queue/queue.c +++ b/test/validation/queue/queue.c @@ -56,7 +56,7 @@ void queue_test_capa(void) odp_queue_param_t qparams; char name[ODP_QUEUE_NAME_LEN]; odp_queue_t queue[MAX_QUEUES]; - uint32_t num_queues, i; + int num_queues, i; memset(&capa, 0, sizeof(odp_queue_capability_t)); CU_ASSERT(odp_queue_capability(&capa) == 0);
The variables i and num_queues must be int rather than uint32_t to avoid a potential loop overrun in the event that the initial odp_queue_create() for i = 0 fails. In this case num_queues is set to -1, but since it is uint32_t it is interpreted as a very large positive number. This resolves Bug https://bugs.linaro.org/show_bug.cgi?id=2377 Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> --- test/validation/queue/queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)