diff options
-rw-r--r-- | test/Makefile.am | 1 | ||||
-rw-r--r-- | test/pixmaps/README.md | 3 | ||||
-rw-r--r-- | test/pixmaps/invalid/unending-comment-c.xpm | 30 |
3 files changed, 34 insertions, 0 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 897eee1..175eccb 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -92,5 +92,6 @@ EXTRA_DIST = \ pixmaps/invalid/doom2.xpm \ pixmaps/invalid/invalid-type.xpm \ pixmaps/invalid/no-contents.xpm \ + pixmaps/invalid/unending-comment-c.xpm \ pixmaps/no-mem/oversize.xpm \ tap-test diff --git a/test/pixmaps/README.md b/test/pixmaps/README.md index 2481d14..f361f77 100644 --- a/test/pixmaps/README.md +++ b/test/pixmaps/README.md @@ -52,6 +52,9 @@ return XpmFileInvalid when parsed. - no-contents.xpm - This file has a valid header but no contents +- unending-comment-c.xpm - This file has a C comment block without the + closing "*/" to test for CVE-2022-46285 + no-mem ------ diff --git a/test/pixmaps/invalid/unending-comment-c.xpm b/test/pixmaps/invalid/unending-comment-c.xpm new file mode 100644 index 0000000..c6056c6 --- /dev/null +++ b/test/pixmaps/invalid/unending-comment-c.xpm @@ -0,0 +1,30 @@ +/* XPM */ +static char * sample_xpm[] = { +"15 19 6 1", +" c None", +". c #FFFFFF", +"+ c #000000", +"@ c #99FFCC", +"# c #66CCCC", +"$ c #339966", +/* This is the comment that never ends, it just goes on and on again... + Based on test case provided by Marco Ivaldi for CVE-2022-46285 +".+++++++++++++.", +"+@@@@@@@@@@@@#+", +"+@###########$+", +"+@###....####$+", +"+@##......###$+", +"+@#...$$...##$+", +"+@#..$$##..$#$+", +"+@##$$##...$#$+", +"+@#####...$$#$+", +"+@####...$$##$+", +"+@####..$$###$+", +"+@####..$####$+", +"+@#####$$####$+", +"+@####..#####$+", +"+@####..$####$+", +"+@#####$$####$+", +"+@###########$+", +"+#$$$$$$$$$$$$+", +".+++++++++++++."}; |