From 567898f17df1dd03685dd276dc72fb6d9f0dab88 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Wed, 7 May 2025 14:52:06 +0200 Subject: [PATCH] xfree86: ddc: safety check for NULL pointer Even though it *should* never be actually hit, it's still safer to check for NULL instead of letting us crash with segfault. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xfree86/ddc/ddc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c index effeff6fc..f075aebd4 100644 --- a/hw/xfree86/ddc/ddc.c +++ b/hw/xfree86/ddc/ddc.c @@ -45,6 +45,9 @@ find_start(unsigned int *ptr) unsigned int comp[9], test[9]; int i, j; + if (!ptr) + return -1; + for (i = 0; i < 9; i++) { comp[i] = *(ptr++); test[i] = 1;