Debian Codegraph @

test/pixmaps/README.md

raw
1 The pixmaps under this directory are used as test cases for several tests.
2 The tests iterate over all files in each directory, so new test cases can be
3 added by just adding a file there, adding it to the `EXTRA_DIST` list in
4 `test/Makefile`, and adding a note here to help us remember what each test case
5 covers. Please make sure all pixmaps are appropriately licensed.
6
7 For details on the different format types, see xpmDataTypes in `src/data.c`,
8 <https://en.wikipedia.org/wiki/X_PixMap>, and
9 <http://fileformats.archiveteam.org/wiki/XPM>.
10
11 good
12 ----
13
14 Those under the `good` subdirectory are expected to work and
15 return XpmSuccess when parsed.
16
17 A subset of these are specifically chosen/designed to test various things:
18
19 - plaid-v3.xpm - copy of the sample XPM file from pg. 10 of `doc/xpm.PS.gz`,
20 in XPM version 3 format
21
22 - plaid-v1.xpm - alternate version of plaid.xpm in XPM version 1 format
23
24 - plaid-v2.xpm - alternate version of plaid.xpm in XPM version 2 "natural" format
25
26 - plaid-lisp.xpm - alternate version of plaid.xpm in XPM Version 2 Lisp format
27
28 - jigglymap.xpm - transparent background
29
30 Other pixmaps in this directory are a selection of real world XPM files
31 with a variety of sizes & numbers of colors.
32
33 invalid
34 -------
35
36 Those under the `invalid` subdirectory are expected to fail and
37 return XpmFileInvalid when parsed.
38
39 - doom.xpm - This file is originally from
40 <http://scary.beasts.org/misc/doom.xpm>.
41 It is a test case for the stack-based overflow in xpmParseColors in
42 CVE-2004-0687 as described in
43 <https://security.appspot.com/security/CESA-2004-003.txt>.
44
45 - doom2.xpm - This file is originally from
46 <http://scary.beasts.org/misc/doom2.xpm>.
47 It is a test case for the stack-based overflow in ParseAndPutPixels
48 and ParsePixels in CVE-2004-0687 as described in
49 <https://security.appspot.com/security/CESA-2004-003.txt>.
50
51 - invalid-type.xpm - This file has an invalid XPM version 2 type header
52
53 - no-contents.xpm - This file has a valid header but no contents
54
55 - unending-comment-c.xpm - This file has a C comment block without the
56 closing "*/" to test for CVE-2022-46285
57
58 - zero-width.xpm & zero-width-v1.xpm - These files declare a width of 0
59 and a height of nearly UINT_MAX, to test for CVE-2022-44617
60
61 - corrupt-colormap.xpm - This file was generated by the clang libfuzzer,
62 and serves as a test for CVE-2023-43789
63
64 - width-overflow.xpm - This file was provided by Yair Mizrahi of
65 the JFrog Vulnerability Research team as a test for CVE-2023-43787.
66 Its width causes an integer overflow when multiplied by a depth of 4 bytes
67 (32-bits) when using 32-bit ints.
68
69 no-mem
70 ------
71
72 Those under the `invalid` subdirectory are expected to fail and
73 return XpmNoMemory when parsed.
74
75 - oversize.xpm - This file specifies more pixels than can be mapped in
76 a 64-bit address space that already has programs & libraries mapped in.
77
78 other
79 -----
80
81 Those under the `other` subdirectory don't fit cleanly in any of the above
82 categories, and may be valid for some uses but not others, and thus can't be
83 easily used in the current test framework, but are still interesting cases.
84
85 - overflow-stackexhaustion.xpm - This file was provided by Yair Mizrahi of
86 the JFrog Vulnerability Research team as a test for CVE-2023-43786.
87 It is a valid XPM file, but is larger than fits into an X Pixmap, so
88 should pass with many functions, but fail when used with sxpm or
89 anything that calls through to xpmCreatePixmapFromImage().