mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-26 08:15:24 +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
parent
e14d352661
commit
fc8f9f4331
@@ -293,8 +293,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