From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D57C10E08C for ; Thu, 16 Mar 2023 14:32:09 +0000 (UTC) From: Swati Sharma To: igt-dev@lists.freedesktop.org Date: Thu, 16 Mar 2023 20:04:37 +0530 Message-Id: <20230316143437.24064-1-swati2.sharma@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [igt-dev] [PATCH i-g-t] tests/kms_plane_scaling: Fix out-of-bound array access List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Coelho@freedesktop.org, Luciano Errors-To: igt-dev-bounces@lists.freedesktop.org Sender: "igt-dev" List-ID: When k == n_planes - 1, we will try to access planes[n_planes], which is out of bounds. Fix this. Reported-by: Coelho, Luciano Signed-off-by: Swati Sharma --- tests/kms_plane_scaling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c index 3a6904af..8d78752c 100644 --- a/tests/kms_plane_scaling.c +++ b/tests/kms_plane_scaling.c @@ -744,7 +744,7 @@ test_planes_scaling_combo(data_t *d, int w1, int h1, int w2, int h2, igt_assert(0); } - for (int k = 0; k < display->pipes[pipe].n_planes; k++) { + for (int k = 0; k < display->pipes[pipe].n_planes - 1; k++) { igt_plane_t *p1, *p2; p1 = &display->pipes[pipe].planes[k]; -- 2.25.1