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

Brian Paul brianp at vmware.com
Mon Mar 23 07:37:08 PDT 2015


On 03/22/2015 12:55 AM, Vinson Lee wrote:
> 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;
>

Reviewed-by: Brian Paul <brianp at vmware.com>




More information about the Piglit mailing list