diff options
author | Ran Benita <ran234@gmail.com> | 2018-03-11 00:04:05 +0200 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2018-07-30 10:35:10 +0300 |
commit | 2cb5c2a3f3a74fb7478648a7811ca2b6e6272311 (patch) | |
tree | c1d58aa95d6408690ea2a346be09387d22ee01a0 /fuzz/keymap/testcases/input.xkb | |
parent | a54cfe087a2b84d5cb44f4dfa0e5951f8289ca3c (diff) | |
download | xorg-lib-libxkbcommon-2cb5c2a3f3a74fb7478648a7811ca2b6e6272311.tar.gz |
Add fuzzing infrastructure
Though text formats aren't exactly fuzzer's strong suit, fuzzers can
catch many surface-level bugs.
The fuzz/ directory contains target programs, testcases and dictionaries
to drive the afl fuzzer.
This commit adds a fuzzer for the XKB keymap text format and the Compose
text format. On my slow machine, using a single core, a full cycle of
the XKB fuzzer takes 5 hours. For Compose, it takes a few minutes.
Fuzzing for the other file formats (rules files mostly) will be added
later.
To do some fuzzing, run `./fuzz/fuzz.sh`.
Signed-off-by: Ran Benita <ran234@gmail.com>
Diffstat (limited to 'fuzz/keymap/testcases/input.xkb')
-rw-r--r-- | fuzz/keymap/testcases/input.xkb | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/fuzz/keymap/testcases/input.xkb b/fuzz/keymap/testcases/input.xkb new file mode 100644 index 0000000..64ea6a3 --- /dev/null +++ b/fuzz/keymap/testcases/input.xkb @@ -0,0 +1,59 @@ +xkb_keymap{ +xkb_keycodes"0"{ +minimum=0; +maximum=500; +<a>=0; +indicator 1="X"; +alias<X>=<Y>; +}; +xkb_types"X"{ +virtual_modifiers NumLock; +type"X"{ +modifiers=Shift; +map[Shift]=Level2; +level_name[Level1]="X"; +preserve[Shift]=Shift; +}; +}; +partial xkb_compat{ +virtual_modifiers Alt; +interpret.useModMapMods=AnyLevel; +interpret.repeat=False; +interpret.locking=False; +interpret ISO_Level2_Latch+Exactly(Shift){ +repeat=True; +virtualModifier=NumLock; +useModMapMods=level1; +action=LatchMods(modifiers=Shift,clearLocks,latchToLock); +action=MovePtr(x=+0,y=-0); +action=SwitchScreen(screen=00,!same); +action=Private(type=0x80,data[0]=0x00); +}; +indicator"X"{whichModState=locked;modifiers=Lock;}; +}; +xkb_symbols{ +name[group1]="X"; +key<Y>{type[group2]="X",symbols[Group1]=[0,exclam],symbols[Group2]=[0xff,U00],symbols[Group3]=[z]}; +modifier_map Control{<a>}; +}; +default xkb_geometry"X"{ +description="X"; +width=470; +shape.cornerRadius=1; +shape"NORM"{cornerRadius=0,{[0.0,0]},{[0,0],[0,0.0]}}; +solid"X"{shape="X";top=00;left=00;color="X";}; +indicator.onColor="X"; +indicator.top=00.0; +indicator.shape="X"; +indicator"X"{left=0;}; +text.top=00; +text.color="X"; +text"X"{left=0;text="X";}; +section.left=00; +row.left=0; +key.shape="X"; +key.gap=1; +section"X"{top=22;row{top=1;keys{{<X>,color="X"},{<X>,00.0},<X>,<X>,<X>};};}; +alias<AC00>=<CAPS>; +}; +}; |