mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-08 06:00:15 +01:00
xkb: Avoid length-check failure on empty strings.
_XkbCheckRequestBounds assumes that from..to is at least one byte.
However, request strings can be empty, causing spurious failures in
XkbGetKbdByName calls. To avoid this, before checking bounds make
sure that the length is nonzero.
(cherry picked from commit 79c572fbd3)
This commit is contained in:
parent
6e61cdc095
commit
be614dbfa6
1 changed files with 4 additions and 4 deletions
|
|
@ -5818,11 +5818,11 @@ GetComponentSpec(ClientPtr client, xkbGetKbdByNameReq *stuff,
|
|||
return NULL;
|
||||
}
|
||||
len = (*(unsigned char *) wire++);
|
||||
if (!_XkbCheckRequestBounds(client, stuff, wire, wire + len)) {
|
||||
*errRtrn = BadLength;
|
||||
return NULL;
|
||||
}
|
||||
if (len > 0) {
|
||||
if (!_XkbCheckRequestBounds(client, stuff, wire, wire + len)) {
|
||||
*errRtrn = BadLength;
|
||||
return NULL;
|
||||
}
|
||||
str = calloc(1, len + 1);
|
||||
if (str) {
|
||||
tmp = str;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue