diff options
| author | FeepingCreature <feepingcreature@gmail.com> | 2022-08-20 20:12:31 +0200 |
|---|---|---|
| committer | FeepingCreature <default_357-line@yahoo.de> | 2022-08-31 06:38:54 +0000 |
| commit | 79c572fbd349cb6373f685a502e430552f856995 (patch) | |
| tree | 6fb623591631b58af54ae93ad322cea0d18e024f /xkb | |
| parent | d23e4465585ec39d39488a5d341ed690c3d93be8 (diff) | |
| download | xserver-79c572fbd349cb6373f685a502e430552f856995.tar.gz | |
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.
Diffstat (limited to 'xkb')
| -rw-r--r-- | xkb/xkb.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -5817,11 +5817,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; |
