From f653d9a0af912e577fab5c02b2a4eb380d33e8bb Mon Sep 17 00:00:00 2001 From: Yusuf Khan Date: Sat, 17 Feb 2024 12:38:10 -0800 Subject: [PATCH] hw/xfree86: fix NULL pointer refrence to mode name Potentially, the pointer to the mode name could be unset, this can occur with the xf86-video-nv DDX, in that case there isnt much we can do except check if the next mode is any better. Signed-off-by: Yusuf Khan --- (cherry picked from db3aa4e03b180244e8b4b02272c49f1e0c48b463) Part-of: --- hw/xfree86/common/xf86Mode.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index eb0885571..ef3be84c3 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -507,6 +507,8 @@ xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep, /* scan through the modes in the sort order above */ if ((p->type & type) != type) continue; + if (p->name == NULL) + continue; if (strcmp(p->name, modep->name) == 0) {