diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2022-12-17 12:18:24 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2023-01-12 15:47:43 -0800 |
commit | f7a167a48a950b89b91f5123a0ec8d9a7cb97495 (patch) | |
tree | 6cbf80ce8fad4229baa8a12181e79324c3925f41 /test/pixmaps | |
parent | 0ff2c6af823ce7712c06150c43c9b403846a035f (diff) |
test: add test case for CVE-2022-46285 (unclosed comments)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'test/pixmaps')
-rw-r--r-- | test/pixmaps/README.md | 3 | ||||
-rw-r--r-- | test/pixmaps/invalid/unending-comment-c.xpm | 30 |
2 files changed, 33 insertions, 0 deletions
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 +".+++++++++++++.", +"+@@@@@@@@@@@@#+", +"+@###########$+", +"+@###....####$+", +"+@##......###$+", +"+@#...$$...##$+", +"+@#..$$##..$#$+", +"+@##$$##...$#$+", +"+@#####...$$#$+", +"+@####...$$##$+", +"+@####..$$###$+", +"+@####..$####$+", +"+@#####$$####$+", +"+@####..#####$+", +"+@####..$####$+", +"+@#####$$####$+", +"+@###########$+", +"+#$$$$$$$$$$$$+", +".+++++++++++++."}; |