[Piglit] [PATCH] arb_pipeline_statistics_query-comp: Fix out-of-bounds reads.

Vinson Lee vlee at freedesktop.org
Sat Mar 21 23:55:49 PDT 2015


Fix out-of-bounds read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c
index c980095..47a36b0 100644
--- a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c
+++ b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c
@@ -122,15 +122,15 @@ test_all_sizes_for_query(void)
 	uint32_t xi, yi, zi;
 	uint32_t x, y, z;
 
-	for (zi = 0; zi <= ARRAY_SIZE(sizes); zi++) {
+	for (zi = 0; zi < ARRAY_SIZE(sizes); zi++) {
 		z = sizes[zi];
 		if (z > 64)
 			break;
-		for (yi = 0; yi <= ARRAY_SIZE(sizes); yi++) {
+		for (yi = 0; yi < ARRAY_SIZE(sizes); yi++) {
 			y = sizes[yi];
 			if ((y * z) > 1024)
 				break;
-			for (xi = 0; xi <= ARRAY_SIZE(sizes); xi++) {
+			for (xi = 0; xi < ARRAY_SIZE(sizes); xi++) {
 				x = sizes[xi];
 				if ((x * y * z) > 1024)
 					break;
-- 
2.2.1



More information about the Piglit mailing list