@@ -19,6 +19,7 @@ extern "C" {
19
19
static scan_arc_ctx_t arc_recurse_media_ctx;
20
20
static scan_arc_ctx_t arc_list_ctx;
21
21
static scan_arc_ctx_t arc_recurse_ooxml_ctx;
22
+ static scan_arc_ctx_t arc_recurse_noop_ctx;
22
23
23
24
static scan_text_ctx_t text_500_ctx;
24
25
@@ -58,6 +59,12 @@ void _parse_ooxml(parse_job_t *job) {
58
59
parse_ooxml (&ooxml_500_ctx, &job->vfile , &LastSubDoc);
59
60
}
60
61
62
+ void _parse_noop (parse_job_t *job) {
63
+ char buf[1024 ];
64
+
65
+ while (job->vfile .read (&job->vfile , buf, sizeof (buf)) != 0 ) {}
66
+ }
67
+
61
68
62
69
/* Text */
63
70
@@ -752,6 +759,16 @@ TEST(Mobi, Azw3) {
752
759
}
753
760
754
761
/* Arc */
762
+ TEST (Arc, ZipBomp) {
763
+ vfile_t f;
764
+ document_t doc;
765
+ load_doc_file (" libscan-test-files/test_files/arc/bomb.zip" , &f, &doc);
766
+
767
+ parse_archive (&arc_recurse_noop_ctx, &f, &doc, nullptr , nullptr );
768
+
769
+ cleanup (&doc, &f);
770
+ }
771
+
755
772
TEST (Arc, Utf8) {
756
773
vfile_t f;
757
774
document_t doc;
@@ -1096,6 +1113,12 @@ int main(int argc, char **argv) {
1096
1113
arc_recurse_ooxml_ctx.mode = ARC_MODE_RECURSE;
1097
1114
arc_recurse_ooxml_ctx.parse = _parse_ooxml;
1098
1115
1116
+ arc_recurse_noop_ctx.log = noop_log;
1117
+ arc_recurse_noop_ctx.logf = noop_logf;
1118
+ arc_recurse_noop_ctx.store = counter_store;
1119
+ arc_recurse_noop_ctx.mode = ARC_MODE_RECURSE;
1120
+ arc_recurse_noop_ctx.parse = _parse_noop;
1121
+
1099
1122
arc_list_ctx.log = noop_log;
1100
1123
arc_list_ctx.logf = noop_logf;
1101
1124
arc_list_ctx.store = counter_store;
0 commit comments