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 <info@metux.net>
This commit is contained in:
Enrico Weigelt, metux IT consult 2025-05-07 14:52:06 +02:00
parent c0d068229b
commit 567898f17d

View File

@ -45,6 +45,9 @@ find_start(unsigned int *ptr)
unsigned int comp[9], test[9]; unsigned int comp[9], test[9];
int i, j; int i, j;
if (!ptr)
return -1;
for (i = 0; i < 9; i++) { for (i = 0; i < 9; i++) {
comp[i] = *(ptr++); comp[i] = *(ptr++);
test[i] = 1; test[i] = 1;