mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-27 02:09:56 +00:00
| Filename | Latest commit message | Latest commit date |
|---|---|---|
The ReadXkm* section readers return the number of bytes they consumed, or -1 when they give up. That contract was spelled as int, while the counters accumulating their results were a mix of int and unsigned, and XkmGetCARD8/16/32() took the counter by reference as an int *. XkmReadFile() also returns an unsigned, but that value is a bitmask of the sections it could not read, not a byte count. Keeping byte counts in unsigned variables right next to it makes the two easy to confuse, and the confusion has a concrete cost: XkmReadFile() kept the readers' results in an unsigned tmp, so the -1 that every one of the seven readers it dispatches to can return became UINT_MAX. That passed the tmp > 0 test below, and the section which had just failed to read was marked as defined and cleared from the mask of sections reported as missing. Use ssize_t, the usual type for "a number of bytes, or -1 on failure", for every byte count in this file: the section readers' return type, the local counters, the counter XkmGetCARD8/16/32() take by reference, and the return values of XkmSkipPadding() and XkmGetCountedString(). An unsigned in this file now only ever denotes a bitmask, and a failing section reader is no longer taken for a successful one. ReadXkmKeyTypes() used a single tmp both for byte counts and as the in/out element count handed to XkmInsureTypedSize(), which needs an int *. That second use gets its own variable. Signed-off-by: Mikhail Dmitrichenko <m.dmitrichenko222@gmail.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2304> |
||
| .. | ||
| ddxBeep.c | ||
| ddxCtrls.c | ||
| ddxKillSrv.c | ||
| ddxLEDs.c | ||
| ddxLoad.c | ||
| ddxPrivate.c | ||
| ddxVT.c | ||
| maprules.c | ||
| meson.build | ||
| README.compiled | ||
| xkb-procs.h | ||
| xkb.c | ||
| xkbAccessX.c | ||
| xkbActions.c | ||
| XKBAlloc.c | ||
| xkbDflts.h | ||
| xkbEvents.c | ||
| xkbfile_priv.h | ||
| xkbfmisc.c | ||
| xkbfmisc_priv.h | ||
| XKBGAlloc.c | ||
| xkbgeom.h | ||
| xkbInit.c | ||
| xkbLEDs.c | ||
| XKBMAlloc.c | ||
| XKBMisc.c | ||
| xkbout.c | ||
| xkbout_priv.h | ||
| xkbPrKeyEv.c | ||
| xkbrules_priv.h | ||
| xkbsrv_priv.h | ||
| xkbtext.c | ||
| xkbtext_priv.h | ||
| xkbUtils.c | ||
| XKM_file_format.txt | ||
| xkmread.c | ||
The X server uses this directory to store the compiled version of the
current keymap and/or any scratch keymaps used by clients. The X server
or some other tool might destroy or replace the files in this directory,
so it is not a safe place to store compiled keymaps for long periods of
time. The default keymap for any server is usually stored in:
X<num>-default.xkm
where <num> is the display number of the server in question, which makes
it possible for several servers *on the same host* to share the same
directory.
Unless the X server is modified, sharing this directory between servers on
different hosts could cause problems.