mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
xfree86: fix infinite boot when parsing incorrect BusID section Device
This change checks if there is a colon after the bus name. If there is none, *retID will point to the final null character of the original string.
This commit is contained in:
committed by
Enrico Weigelt, metux IT consult
parent
70b3821113
commit
83b0ce7275
@@ -290,8 +290,13 @@ StringToBusType(const char *busID, const char **retID)
|
||||
if (!xf86NameCmp(p, "usb"))
|
||||
ret = BUS_USB;
|
||||
if (ret != BUS_NONE)
|
||||
if (retID)
|
||||
*retID = busID + strlen(p) + 1;
|
||||
if (retID) {
|
||||
size_t len = strlen(p);
|
||||
if (busID[len] == ':')
|
||||
*retID = busID + len + 1;
|
||||
else
|
||||
*retID = busID + len; /* Points to the terminating null byte */
|
||||
}
|
||||
free(s);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user