[PATCH i-g-t v3 1/2] lib/igt_panel: Validate vendor name in igt_is_panel_blocked

Santhosh Reddy Guddati santhosh.reddy.guddati at intel.com
Thu Jun 12 05:13:25 UTC 2025


Avoids false positives by returning false early when the vendor name is
NULL, empty, or a single whitespace character.

V2: Add Fixes tag (Suraj)

V3: Split the commit and indentation (Kamil)

Fixes: ec444a83c8ff ("lib/igt_panel: Skip hdcp tests on unsupported panels")
Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
---
 lib/igt_panel.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/igt_panel.c b/lib/igt_panel.c
index c89bf9123..a5aa83e8b 100644
--- a/lib/igt_panel.c
+++ b/lib/igt_panel.c
@@ -20,11 +20,15 @@
  * true if the vendor name is found in the blocklist, false otherwise.
  */
 bool igt_is_panel_blocked(const char *vendor_name,
-			    const char *const blocklist[],
-			    size_t blocklist_size)
+			  const char *const blocklist[],
+			  size_t blocklist_size)
 {
 	int i;
 
+	if (!vendor_name || vendor_name[0] == '\0' ||
+	    (vendor_name[0] == ' ' && vendor_name[1] == '\0'))
+		return false;
+
 	for (i = 0; i < blocklist_size; i++) {
 		if (strstr(blocklist[i], vendor_name) != NULL)
 			return true;
-- 
2.34.1



More information about the igt-dev mailing list