libinput/test
Peter Hutterer 71a2c5cae2 util: sanitize control characters in str_sanitize()
str_sanitize() only escaped '%' characters for format string safety.
Device names from uinput devices can contain arbitrary bytes including
ANSI escape sequences (ESC, 0x1b) and other control characters. When
these strings are included in log messages and printed to a terminal,
the escape sequences are interpreted by the terminal emulator. This
could allow an attacker to manipulate terminal output (change colors,
set window title, clear screen) when an administrator views libinput
logs.

Replace all control characters (0x00-0x1f and 0x7f) with '?' in
addition to the existing '%' escaping. This prevents terminal escape
sequence injection through device names in log output.

Assisted-by: Claude:claude-opus-4-6
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1486>
2026-06-03 21:45:28 +00:00
..
.clang-tidy Add a clang-tidy file 2025-04-07 08:43:36 +00:00
50-litest.conf test: rename the identifier in the 50-litest.conf 2020-07-15 09:36:48 +10:00
build-cxx.cc meson.build: drop the separate cpp flags 2020-09-09 13:57:39 +10:00
build-pedantic.c Fix a couple of coding style issues 2015-05-01 12:09:57 +10:00
check-leftover-udev-rules.sh test: add a script to check for leftover litest rules 2018-03-23 12:41:23 +10:00
generate-gcov-report.sh Hook up gcov for coverage reports 2017-01-20 10:35:37 +10:00
helper-copy-and-exec-from-tmp.sh tools: move the builddir lookup function out to a separate file 2019-03-14 11:28:05 +10:00
libinput-test-suite.man test: rename the identifier in the 50-litest.conf 2020-07-15 09:36:48 +10:00
litest-device-absinfo-override.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-acer-hawaii-keyboard.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-acer-hawaii-touchpad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-aiptek-tablet.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-alps-3fg.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-alps-dualpoint.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-alps-semi-mt.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-anker-mouse-kbd.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-apple-appletouch.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-apple-internal-keyboard.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-apple-magicmouse.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-asus-rog-gladius.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-atmel-hover.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-bcm5974.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-calibrated-touchscreen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-cyborg-rat-5.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-dell-canvas-totem-touch.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-dell-canvas-totem.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-elan-tablet.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-elantech-touchpad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-format-string.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-generic-pressurepad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-generic-singletouch.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-generic-usb-keyboard.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-generic-usb-touchpad.c evdev: use udev's ID_INTEGRATION 2026-03-10 02:27:36 +00:00
litest-device-gpio-keys.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-hp-wmi-hotkeys.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-huion-pentablet.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-huion-q620m-dial.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-ignored-mouse.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-keyboard-all-codes.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-keyboard-quirked.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-keyboard-razer-blackwidow.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-keyboard-razer-blade-stealth-videoswitch.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-keyboard-razer-blade-stealth.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-keyboard.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-keypad-slide-switch.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-lenovo-scrollpoint.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-lid-switch-surface3.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-lid-switch.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-logitech-media-keyboard-elite.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-logitech-trackball.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-magic-trackpad.c evdev: use udev's ID_INTEGRATION 2026-03-10 02:27:36 +00:00
litest-device-mouse-low-dpi.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse-ps2.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse-roccat.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse-virtual.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse-wheel-click-angle.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse-wheel-click-count.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse-wheel-hires-disabled.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse-wheel-tilt.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-mouse.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-ms-nano-transceiver-mouse.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-ms-surface-cover.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-nexus4-touch-screen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-ploopy-pavonis-stylus.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-protocol-a-touch-screen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-qemu-usb-tablet.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-sony-vaio-keys.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-hover.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-i2c.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-phantomclicks.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-pressurepad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-rmi4.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-st.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-t440.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-x1-carbon-3rd.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-synaptics-x220.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-tablet-doubledial.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-tablet-mode-switch.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-tablet-rel-dial.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-thinkpad-extrabuttons.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-touch-screen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-touchpad-palm-threshold-zero.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-touchscreen-fuzz.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-touchscreen-invalid-range.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-touchscreen-mt-tool.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-trackpoint.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-uclogic-tablet.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-vmware-virtual-usb-mouse.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-bamboo-2fg-finger.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-bamboo-2fg-pad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-bamboo-2fg-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-bamboo-16fg-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-calibrated-tablet.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-12wx-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-13hdt-finger.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-13hdt-pad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-13hdt-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-24hd-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-24hdt-pad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-pro-16-finger.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-pro-16-pad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-cintiq-pro-16-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-ekr.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-hid4800-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-intuos3-pad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-intuos5-finger.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-intuos5-pad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-intuos5-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-isdv4-524c-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-isdv4-4200-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-isdv4-e6-finger.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-isdv4-e6-pen.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wacom-mobilestudio-pro-pad.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-waltop-tablet.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-wheel-only.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-xen-virtual-pointer.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-device-yubikey.c test: set ID_INTEGRATION into test devices 2026-03-10 02:27:36 +00:00
litest-int.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
litest-main.c Fix clang-tidy false positives 2025-11-06 23:31:27 +00:00
litest-runner.c Use a newtype usec_t for timestamps for better type-safety 2025-12-12 04:15:15 +00:00
litest-runner.h Run clang-format over the code 2025-07-01 16:42:44 +10:00
litest-selftest.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
litest.c test: change the gesture state color to normal yellow 2026-01-20 14:59:02 +10:00
litest.h totem: require both touch size axes to have resolution 2026-06-03 21:45:28 +00:00
symbols-leak-test test: print the usage from the symbols-leak-test 2022-11-22 19:02:03 +00:00
test-builddir-lookup.c meson: revamp the debug build detection for the builddir lookup 2026-01-10 10:39:21 +00:00
test-device.c evdev: be stricter about devices with odd absinfo values 2026-06-03 21:45:28 +00:00
test-gestures.c touchpad: time the 3fg fast swipe timeout from the initial contact 2026-04-17 02:32:50 +00:00
test-keyboard.c test: fix the keycode obfuscation test 2025-08-01 04:02:57 +00:00
test-library-version.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
test-log.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
test-misc.c evdev: add support for SW_KEYPAD_SLIDE 2025-12-11 13:28:41 +02:00
test-pad.c pad: ignore invalid strip axis values 2026-06-03 21:45:28 +00:00
test-path.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
test-plugins-lua.c lua: force text mode for loading plugins 2026-04-01 23:53:12 +00:00
test-pointer.c Fold hold-to-scroll into existing scroll button lock mode 2026-03-10 23:12:25 +00:00
test-quirks.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
test-switch.c evdev: add support for SW_KEYPAD_SLIDE 2025-12-11 13:28:41 +02:00
test-tablet.c tablet: extend touch arbitration rect to cover full tablet height 2026-04-16 05:10:53 +00:00
test-totem.c totem: require both touch size axes to have resolution 2026-06-03 21:45:28 +00:00
test-touch.c meson.build: change from config.set10() and #if to config.set() and #ifdef 2025-07-28 12:04:09 +10:00
test-touchpad-buttons.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
test-touchpad-tap.c touchpad: support automatic drag-lock when releasing at the edge 2026-03-24 05:50:24 +00:00
test-touchpad.c touchpad: add get_default_timeout for dwt and dwtp 2026-02-03 13:01:59 +10:00
test-trackball.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
test-trackpoint.c touchpad: add configurable timeouts to disable-while-trackpointing 2025-12-02 09:24:15 +10:00
test-udev.c Run clang-format over the code 2025-07-01 16:42:44 +10:00
test-util-includes.c.in test: rename test-util-includes.c to .c.in 2025-04-04 15:47:23 +00:00
test-utils.c util: sanitize control characters in str_sanitize() 2026-06-03 21:45:28 +00:00
test_quirks_files.py quirks: add missing modification warning to a quirks file 2026-04-14 09:48:15 +10:00
valgrind.suppressions test: grab the device before any lid or tablet mode switches 2020-07-07 18:51:33 +10:00