xfree86: loader: add assert() in LoadModule()

There's (remote) chance that the (internal) module name could become
NULL (eg. allocation failure). Even though chances to hit it are very
low, it's still better to have a check here (that doesn't cost us much),
just in case. Assert fail is still better than segfault, since we're
at least getting some hint what might have happened.

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:56:59 +02:00
parent b28285332e
commit 7ae09df3ae

View File

@ -702,6 +702,8 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
if (!strcmp(m, "vbe"))
m = name = strdup("int10");
assert(m);
for (cim = compiled_in_modules; *cim; cim++)
if (!strcmp(m, *cim)) {
LogMessageVerb(X_INFO, 3, "Module \"%s\" already built-in\n", m);