-
Notifications
You must be signed in to change notification settings - Fork 7
/
pure_errors.h
505 lines (503 loc) · 20.2 KB
/
pure_errors.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
enum PURE_E {
PURE_E_OK,
PURE_E_SIZE_MAX,
PURE_E_MALLOC,
PURE_E_STRING_NOT_FOUND,
PURE_E_UINT64_OVERFLOW,
PURE_E_ZIP_BOMB_ARCHIVES,
PURE_E_ZIP_BOMB_DEPTH,
PURE_E_ZIP_BOMB_FIFIELD,
PURE_E_ZIP_BOMB_FILES,
PURE_E_ZIP_BOMB_RATIO,
PURE_E_ZIP_BOMB_INFLATE_COMPRESSED_OVERFLOW,
PURE_E_ZIP_BOMB_INFLATE_UNCOMPRESSED_OVERFLOW,
PURE_E_ZIP_TOO_SMALL,
PURE_E_ZIP_SIZE_4GB,
PURE_E_ZIP_RAR,
PURE_E_ZIP_TAR,
PURE_E_ZIP_XAR,
PURE_E_ZIP_SIGNATURE,
PURE_E_ZIP_EOCDR_NOT_FOUND,
PURE_E_ZIP_EOCDR_OVERFLOW,
PURE_E_ZIP_EOCDR_COMMENT_OVERFLOW,
PURE_E_ZIP_EOCDR_SIGNATURE,
PURE_E_ZIP_EOCDR_RECORDS,
PURE_E_ZIP_EOCDR_SIZE_OVERFLOW,
PURE_E_ZIP_EOCDR_SIZE_UNDERFLOW,
PURE_E_ZIP_MULTIPLE_DISKS,
PURE_E_ZIP_APPENDED_DATA_ZEROED,
PURE_E_ZIP_APPENDED_DATA_BUFFER_BLEED,
PURE_E_ZIP_PREPENDED_DATA,
PURE_E_ZIP_PREPENDED_DATA_ZEROED,
PURE_E_ZIP_PREPENDED_DATA_BUFFER_BLEED,
PURE_E_ZIP_CDH_OVERFLOW,
PURE_E_ZIP_CDH_SIGNATURE,
PURE_E_ZIP_CDH_RELATIVE_OFFSET_OVERFLOW,
PURE_E_ZIP_CDH_RELATIVE_OFFSET_OVERLAP,
PURE_E_ZIP_CDH_FILE_NAME_OVERFLOW,
PURE_E_ZIP_CDH_EXTRA_FIELD_OVERFLOW,
PURE_E_ZIP_CDH_FILE_COM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F_DDR_UNCOMPRESSED_SIZE,
PURE_E_ZIP_FLAG_OVERFLOW,
PURE_E_ZIP_FLAG_TRADITIONAL_ENCRYPTION,
PURE_E_ZIP_FLAG_ENHANCED_DEFLATE,
PURE_E_ZIP_FLAG_COMPRESSED_PATCHED_DATA,
PURE_E_ZIP_FLAG_STRONG_ENCRYPTION,
PURE_E_ZIP_FLAG_UNUSED_BIT_7,
PURE_E_ZIP_FLAG_UNUSED_BIT_8,
PURE_E_ZIP_FLAG_UNUSED_BIT_9,
PURE_E_ZIP_FLAG_UNUSED_BIT_10,
PURE_E_ZIP_FLAG_ENHANCED_COMPRESSION,
PURE_E_ZIP_FLAG_MASKED_LOCAL_HEADERS,
PURE_E_ZIP_FLAG_RESERVED_BIT_14,
PURE_E_ZIP_FLAG_RESERVED_BIT_15,
PURE_E_ZIP_COMPRESSION_METHOD_DANGEROUS,
PURE_E_ZIP_COMPRESSION_METHOD_ENCRYPTED,
PURE_E_ZIP_COMPRESSION_METHOD_UNSUPPORTED,
PURE_E_ZIP_STORED_COMPRESSION_SIZE_MISMATCH,
PURE_E_ZIP_DANGEROUS_NEGATIVE_COMPRESSION_RATIO,
PURE_E_ZIP_TIME_OVERFLOW,
PURE_E_ZIP_TIME_HOUR_OVERFLOW,
PURE_E_ZIP_TIME_MINUTE_OVERFLOW,
PURE_E_ZIP_TIME_SECOND_OVERFLOW,
PURE_E_ZIP_DATE_OVERFLOW,
PURE_E_ZIP_DATE_YEAR_OVERFLOW,
PURE_E_ZIP_DATE_MONTH_OVERFLOW,
PURE_E_ZIP_DATE_DAY_OVERFLOW,
PURE_E_ZIP_FILE_NAME_LENGTH,
PURE_E_ZIP_FILE_NAME_CONTROL_CHARACTERS,
PURE_E_ZIP_FILE_NAME_TRAVERSAL_DRIVE_PATH,
PURE_E_ZIP_FILE_NAME_TRAVERSAL_RELATIVE_PATH,
PURE_E_ZIP_FILE_NAME_TRAVERSAL_DOUBLE_DOTS,
PURE_E_ZIP_FILE_NAME_COMPONENT_OVERFLOW,
PURE_E_ZIP_FILE_NAME_BACKSLASH,
PURE_E_ZIP_EXTRA_FIELD_MAX,
PURE_E_ZIP_EXTRA_FIELD_MIN,
PURE_E_ZIP_EXTRA_FIELD_ATTRIBUTE_OVERFLOW,
PURE_E_ZIP_EXTRA_FIELD_OVERFLOW,
PURE_E_ZIP_EXTRA_FIELD_UNDERFLOW_ZEROED,
PURE_E_ZIP_EXTRA_FIELD_UNDERFLOW_BUFFER_BLEED,
PURE_E_ZIP_EXTRA_FIELD_UNICODE_PATH_OVERFLOW,
PURE_E_ZIP_EXTRA_FIELD_UNICODE_PATH_VERSION,
PURE_E_ZIP_EXTRA_FIELD_UNICODE_PATH_DIFF,
PURE_E_ZIP_UNIX_MODE_OVERFLOW,
PURE_E_ZIP_UNIX_MODE_BLOCK_DEVICE,
PURE_E_ZIP_UNIX_MODE_CHARACTER_DEVICE,
PURE_E_ZIP_UNIX_MODE_FIFO,
PURE_E_ZIP_UNIX_MODE_SOCKET,
PURE_E_ZIP_UNIX_MODE_PERMISSIONS_STICKY,
PURE_E_ZIP_UNIX_MODE_PERMISSIONS_SETGID,
PURE_E_ZIP_UNIX_MODE_PERMISSIONS_SETUID,
PURE_E_ZIP_DIRECTORY_COMPRESSED,
PURE_E_ZIP_DIRECTORY_UNCOMPRESSED,
PURE_E_ZIP_SYMLINK_COMPRESSED,
PURE_E_ZIP_SYMLINK_LENGTH,
PURE_E_ZIP_SYMLINK_CONTROL_CHARACTERS,
PURE_E_ZIP_SYMLINK_TRAVERSAL_DRIVE_PATH,
PURE_E_ZIP_SYMLINK_TRAVERSAL_RELATIVE_PATH,
PURE_E_ZIP_SYMLINK_TRAVERSAL_DOUBLE_DOTS,
PURE_E_ZIP_SYMLINK_COMPONENT_OVERFLOW,
PURE_E_ZIP_STRING_MAX,
PURE_E_ZIP_STRING_NULL_BYTE,
PURE_E_ZIP_INFLATE,
PURE_E_ZIP_INFLATE_DICTIONARY,
PURE_E_ZIP_INFLATE_STREAM,
PURE_E_ZIP_INFLATE_DATA,
PURE_E_ZIP_INFLATE_MEMORY,
PURE_E_ZIP_INFLATE_COMPRESSED_UNDERFLOW,
PURE_E_ZIP_INFLATE_UNCOMPRESSED_UNDERFLOW,
PURE_E_ZIP_AD_NIHILO,
PURE_E_ZIP_EX_NIHILO,
PURE_E_ZIP_CRC32,
PURE_E_ZIP_EOCDL_64_OVERFLOW,
PURE_E_ZIP_EOCDL_64_SIGNATURE,
PURE_E_ZIP_EOCDL_64_NEGATIVE_OFFSET,
PURE_E_ZIP_EOCDL_64_DISK,
PURE_E_ZIP_EOCDL_64_DISKS,
PURE_E_ZIP_EOCDR_64_OVERFLOW,
PURE_E_ZIP_EOCDR_64_SIGNATURE,
PURE_E_ZIP_EOCDR_EOCDL_64_OVERFLOW,
PURE_E_ZIP_EOCDR_EOCDL_64_UNDERFLOW_ZEROED,
PURE_E_ZIP_EOCDR_EOCDL_64_UNDERFLOW_BUFFER_BLEED,
PURE_E_ZIP_DIFF_EOCDR_DISK,
PURE_E_ZIP_DIFF_EOCDR_CD_DISK,
PURE_E_ZIP_DIFF_EOCDR_CD_DISK_RECORDS,
PURE_E_ZIP_DIFF_EOCDR_CD_RECORDS,
PURE_E_ZIP_DIFF_EOCDR_CD_SIZE,
PURE_E_ZIP_DIFF_EOCDR_CD_OFFSET,
PURE_E_ZIP_EIEF_64_COMPRESSED_SIZE,
PURE_E_ZIP_EIEF_64_DISK,
PURE_E_ZIP_EIEF_64_RELATIVE_OFFSET,
PURE_E_ZIP_EIEF_64_UNCOMPRESSED_SIZE,
PURE_E_ZIP_EIEF_64_UNDERFLOW_ZEROED,
PURE_E_ZIP_EIEF_64_UNDERFLOW_BUFFER_BLEED,
PURE_E_ZIP_EIEF_64_LFH,
PURE_E_ZIP_DIRECTORY_HAS_NO_LFH,
// Capture enum length for bounds checking by pure_error_string():
PURE_E_ENUM_LENGTH
};
const char* const PURE_E_CODES[] = {
"PURE_E_OK",
"PURE_E_SIZE_MAX",
"PURE_E_MALLOC",
"PURE_E_STRING_NOT_FOUND",
"PURE_E_UINT64_OVERFLOW",
"PURE_E_ZIP_BOMB_ARCHIVES",
"PURE_E_ZIP_BOMB_DEPTH",
"PURE_E_ZIP_BOMB_FIFIELD",
"PURE_E_ZIP_BOMB_FILES",
"PURE_E_ZIP_BOMB_RATIO",
"PURE_E_ZIP_BOMB_INFLATE_COMPRESSED_OVERFLOW",
"PURE_E_ZIP_BOMB_INFLATE_UNCOMPRESSED_OVERFLOW",
"PURE_E_ZIP_TOO_SMALL",
"PURE_E_ZIP_SIZE_4GB",
"PURE_E_ZIP_RAR",
"PURE_E_ZIP_TAR",
"PURE_E_ZIP_XAR",
"PURE_E_ZIP_SIGNATURE",
"PURE_E_ZIP_EOCDR_NOT_FOUND",
"PURE_E_ZIP_EOCDR_OVERFLOW",
"PURE_E_ZIP_EOCDR_COMMENT_OVERFLOW",
"PURE_E_ZIP_EOCDR_SIGNATURE",
"PURE_E_ZIP_EOCDR_RECORDS",
"PURE_E_ZIP_EOCDR_SIZE_OVERFLOW",
"PURE_E_ZIP_EOCDR_SIZE_UNDERFLOW",
"PURE_E_ZIP_MULTIPLE_DISKS",
"PURE_E_ZIP_APPENDED_DATA_ZEROED",
"PURE_E_ZIP_APPENDED_DATA_BUFFER_BLEED",
"PURE_E_ZIP_PREPENDED_DATA",
"PURE_E_ZIP_PREPENDED_DATA_ZEROED",
"PURE_E_ZIP_PREPENDED_DATA_BUFFER_BLEED",
"PURE_E_ZIP_CDH_OVERFLOW",
"PURE_E_ZIP_CDH_SIGNATURE",
"PURE_E_ZIP_CDH_RELATIVE_OFFSET_OVERFLOW",
"PURE_E_ZIP_CDH_RELATIVE_OFFSET_OVERLAP",
"PURE_E_ZIP_CDH_FILE_NAME_OVERFLOW",
"PURE_E_ZIP_CDH_EXTRA_FIELD_OVERFLOW",
"PURE_E_ZIP_CDH_FILE_COMMENT_OVERFLOW",
"PURE_E_ZIP_LFH_OVERFLOW",
"PURE_E_ZIP_LFH_S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"PURE_E_ZIP_FLAG_OVERFLOW",
"PURE_E_ZIP_FLAG_TRADITIONAL_ENCRYPTION",
"PURE_E_ZIP_FLAG_ENHANCED_DEFLATE",
"PURE_E_ZIP_FLAG_COMPRESSED_PATCHED_DATA",
"PURE_E_ZIP_FLAG_STRONG_ENCRYPTION",
"PURE_E_ZIP_FLAG_UNUSED_BIT_7",
"PURE_E_ZIP_FLAG_UNUSED_BIT_8",
"PURE_E_ZIP_FLAG_UNUSED_BIT_9",
"PURE_E_ZIP_FLAG_UNUSED_BIT_10",
"PURE_E_ZIP_FLAG_ENHANCED_COMPRESSION",
"PURE_E_ZIP_FLAG_MASKED_LOCAL_HEADERS",
"PURE_E_ZIP_FLAG_RESERVED_BIT_14",
"PURE_E_ZIP_FLAG_RESERVED_BIT_15",
"PURE_E_ZIP_COMPRESSION_METHOD_DANGEROUS",
"PURE_E_ZIP_COMPRESSION_METHOD_ENCRYPTED",
"PURE_E_ZIP_COMPRESSION_METHOD_UNSUPPORTED",
"PURE_E_ZIP_STORED_COMPRESSION_SIZE_MISMATCH",
"PURE_E_ZIP_DANGEROUS_NEGATIVE_COMPRESSION_RATIO",
"PURE_E_ZIP_TIME_OVERFLOW",
"PURE_E_ZIP_TIME_HOUR_OVERFLOW",
"PURE_E_ZIP_TIME_MINUTE_OVERFLOW",
"PURE_E_ZIP_TIME_SECOND_OVERFLOW",
"PURE_E_ZIP_DATE_OVERFLOW",
"PURE_E_ZIP_DATE_YEAR_OVERFLOW",
"PURE_E_ZIP_DATE_MONTH_OVERFLOW",
"PURE_E_ZIP_DATE_DAY_OVERFLOW",
"PURE_E_ZIP_FILE_NAME_LENGTH",
"PURE_E_ZIP_FILE_NAME_CONTROL_CHARACTERS",
"PURE_E_ZIP_FILE_NAME_TRAVERSAL_DRIVE_PATH",
"PURE_E_ZIP_FILE_NAME_TRAVERSAL_RELATIVE_PATH",
"PURE_E_ZIP_FILE_NAME_TRAVERSAL_DOUBLE_DOTS",
"PURE_E_ZIP_FILE_NAME_COMPONENT_OVERFLOW",
"PURE_E_ZIP_FILE_NAME_BACKSLASH",
"PURE_E_ZIP_EXTRA_FIELD_MAX",
"PURE_E_ZIP_EXTRA_FIELD_MIN",
"PURE_E_ZIP_EXTRA_FIELD_ATTRIBUTE_OVERFLOW",
"PURE_E_ZIP_EXTRA_FIELD_OVERFLOW",
"PURE_E_ZIP_EXTRA_FIELD_UNDERFLOW_ZEROED",
"PURE_E_ZIP_EXTRA_FIELD_UNDERFLOW_BUFFER_BLEED",
"PURE_E_ZIP_EXTRA_FIELD_UNICODE_PATH_OVERFLOW",
"PURE_E_ZIP_EXTRA_FIELD_UNICODE_PATH_VERSION",
"PURE_E_ZIP_EXTRA_FIELD_UNICODE_PATH_DIFF",
"PURE_E_ZIP_UNIX_MODE_OVERFLOW",
"PURE_E_ZIP_UNIX_MODE_BLOCK_DEVICE",
"PURE_E_ZIP_UNIX_MODE_CHARACTER_DEVICE",
"PURE_E_ZIP_UNIX_MODE_FIFO",
"PURE_E_ZIP_UNIX_MODE_SOCKET",
"PURE_E_ZIP_UNIX_MODE_PERMISSIONS_STICKY",
"PURE_E_ZIP_UNIX_MODE_PERMISSIONS_SETGID",
"PURE_E_ZIP_UNIX_MODE_PERMISSIONS_SETUID",
"PURE_E_ZIP_DIRECTORY_COMPRESSED",
"PURE_E_ZIP_DIRECTORY_UNCOMPRESSED",
"PURE_E_ZIP_SYMLINK_COMPRESSED",
"PURE_E_ZIP_SYMLINK_LENGTH",
"PURE_E_ZIP_SYMLINK_CONTROL_CHARACTERS",
"PURE_E_ZIP_SYMLINK_TRAVERSAL_DRIVE_PATH",
"PURE_E_ZIP_SYMLINK_TRAVERSAL_RELATIVE_PATH",
"PURE_E_ZIP_SYMLINK_TRAVERSAL_DOUBLE_DOTS",
"PURE_E_ZIP_SYMLINK_COMPONENT_OVERFLOW",
"PURE_E_ZIP_STRING_MAX",
"PURE_E_ZIP_STRING_NULL_BYTE",
"PURE_E_ZIP_INFLATE",
"PURE_E_ZIP_INFLATE_DICTIONARY",
"PURE_E_ZIP_INFLATE_STREAM",
"PURE_E_ZIP_INFLATE_DATA",
"PURE_E_ZIP_INFLATE_MEMORY",
"PURE_E_ZIP_INFLATE_COMPRESSED_UNDERFLOW",
"PURE_E_ZIP_INFLATE_UNCOMPRESSED_UNDERFLOW",
"PURE_E_ZIP_AD_NIHILO",
"PURE_E_ZIP_EX_NIHILO",
"PURE_E_ZIP_CRC32",
"PURE_E_ZIP_EOCDL_64_OVERFLOW",
"PURE_E_ZIP_EOCDL_64_SIGNATURE",
"PURE_E_ZIP_EOCDL_64_NEGATIVE_OFFSET",
"PURE_E_ZIP_EOCDL_64_DISK",
"PURE_E_ZIP_EOCDL_64_DISKS",
"PURE_E_ZIP_EOCDR_64_OVERFLOW",
"PURE_E_ZIP_EOCDR_64_SIGNATURE",
"PURE_E_ZIP_EOCDR_EOCDL_64_OVERFLOW",
"PURE_E_ZIP_EOCDR_EOCDL_64_UNDERFLOW_ZEROED",
"PURE_E_ZIP_EOCDR_EOCDL_64_UNDERFLOW_BUFFER_BLEED",
"PURE_E_ZIP_DIFF_EOCDR_DISK",
"PURE_E_ZIP_DIFF_EOCDR_CD_DISK",
"PURE_E_ZIP_DIFF_EOCDR_CD_DISK_RECORDS",
"PURE_E_ZIP_DIFF_EOCDR_CD_RECORDS",
"PURE_E_ZIP_DIFF_EOCDR_CD_SIZE",
"PURE_E_ZIP_DIFF_EOCDR_CD_OFFSET",
"PURE_E_ZIP_EIEF_64_COMPRESSED_SIZE",
"PURE_E_ZIP_EIEF_64_DISK",
"PURE_E_ZIP_EIEF_64_RELATIVE_OFFSET",
"PURE_E_ZIP_EIEF_64_UNCOMPRESSED_SIZE",
"PURE_E_ZIP_EIEF_64_UNDERFLOW_ZEROED",
"PURE_E_ZIP_EIEF_64_UNDERFLOW_BUFFER_BLEED",
"PURE_E_ZIP_EIEF_64_LFH",
"PURE_E_ZIP_DIRECTORY_HAS_NO_LFH"
};
const char* const PURE_E_STRINGS[] = {
"file is pure",
"exceeded 64 GB limit",
"insufficient memory",
"string not found",
"uint64_t overflow",
"zip bomb: too many archives",
"zip bomb: too much recursion",
"zip bomb: local file header overlap (see research by David Fifield)",
"zip bomb: too many files",
"zip bomb: dangerous compression ratio and uncompressed size",
"zip bomb: compressed data is larger than compressed size (overflow)",
"zip bomb: uncompressed data is larger than uncompressed size (overflow)",
"zip file too small (minimum size is 22 bytes)",
"unsupported: zip file exceeds 4 GB limit (ZIP64)",
"not a zip file (malicious rar)",
"not a zip file (malicious tar)",
"not a zip file (malicious xar)",
"not a zip file (bad signature)",
"end of central directory record: not found",
"end of central directory record: overflow",
"end of central directory record: comment overflow",
"end of central directory record: bad signature",
"end of central directory record: cd_disk_records != cd_records",
"end of central directory record: cd_size too small for number of cd_records",
"end of central directory record: cd_size > 0 but cd_records == 0",
"unsupported: multiple disks",
"zip file has appended data (zeroed)",
"zip file has appended data (buffer bleed)",
"zip file has prepended data",
"zip file has prepended data (zeroed)",
"zip file has prepended data (buffer bleed)",
"central directory header: overflow",
"central directory header: bad signature",
"central directory header: relative offset overflow",
"central directory header: relative offset overlaps central directory",
"central directory header: file name overflow",
"central directory header: extra field overflow",
"central directory header: file comment overflow",
"local file header: overflow",
"local file header: bad signature",
"local file header: file name overflow",
"local file header: extra field overflow",
"local file header: gap (zeroed)",
"local file header: gap (buffer bleed)",
"local file header: data overflow",
"data descriptor record: overflow",
"zip file has overlap between last local file and central directory",
"zip file has gap between last local file and central directory (zeroed)",
"zip file has gap between last local file and central directory (buffer bleed)",
"central directory: overflow",
"central directory: underflow (zeroed)",
"central directory: underflow (buffer bleed)",
"central directory overlaps end of central directory record",
"zip file has gap between central directory and end of central directory record (zeroed)",
"zip file has gap between central directory and end of central directory record (buffer bleed)",
"local file header diverges from central directory header: general purpose bit flag",
"local file header diverges from central directory header: compression method",
"local file header diverges from central directory header: last mod file time",
"local file header diverges from central directory header: last mod file date",
"local file header diverges from central directory header: crc32",
"local file header diverges from central directory header: compressed size",
"local file header diverges from central directory header: uncompressed size",
"local file header diverges from central directory header: file name length",
"local file header diverges from central directory header: file name",
"local file header diverges from data descriptor record: crc32",
"local file header diverges from data descriptor record: compressed size",
"local file header diverges from data descriptor record: uncompressed size",
"data descriptor record diverges from central directory header: crc32",
"data descriptor record diverges from central directory header: compressed size",
"data descriptor record diverges from central directory header: uncompressed size",
"general purpose bit flag: 16-bit overflow",
"unsupported: traditional encryption",
"unsupported: enhanced deflate",
"unsupported: compressed patched data",
"unsupported: strong encryption",
"unsupported: unused flag (bit 7)",
"unsupported: unused flag (bit 8)",
"unsupported: unused flag (bit 9)",
"unsupported: unused flag (bit 10)",
"unsupported: enhanced compression",
"unsupported: masked local headers",
"unsupported: reserved flag (bit 14)",
"unsupported: reserved flag (bit 15)",
"compression method: exceeds 999 (CVE-2016-9844)",
"compression method: encrypted",
"compression method: must be 0 or 8",
"file stored with no compression has mismatching compressed and uncompressed sizes",
"dangerous negative compression ratio (CVE-2018-18384)",
"time: 16-bit overflow",
"time: ms-dos hour: overflow",
"time: ms-dos minute: overflow",
"time: ms-dos second: overflow",
"date: 16-bit overflow",
"date: ms-dos year: overflow",
"date: ms-dos month: overflow",
"date: ms-dos day: overflow",
"file name exceeds 4096 bytes (CVE-2018-1000035)",
"file name contains control characters (CVE-2003-0282)",
"directory traversal (via file name drive path)",
"directory traversal (via file name relative path)",
"directory traversal (via file name double dots)",
"file name path component exceeds 255 bytes",
"file name contains backslash",
"extra field length exceeds maximum",
"extra field length must be 0 or at least 4 bytes",
"extra field: attribute overflow",
"extra field: overflow",
"extra field: underflow (zeroed)",
"extra field: underflow (buffer bleed)",
"extra field: unicode path overflow",
"extra field: unicode path has an invalid version",
"extra field: unicode path diverges from file name",
"unix mode: overflow",
"unix mode: dangerous type (block device)",
"unix mode: dangerous type (character device)",
"unix mode: dangerous type (fifo)",
"unix mode: dangerous type (socket)",
"unix mode: dangerous permissions (sticky)",
"unix mode: dangerous permissions (setgid)",
"unix mode: dangerous permissions (setuid)",
"directory: non-zero compressed size",
"directory: non-zero uncompressed size",
"unsupported: compressed symlink",
"symlink exceeds 4096 bytes (CVE-2018-1000035)",
"symlink contains control characters (CVE-2003-0282)",
"directory traversal (via symlink drive path)",
"directory traversal (via symlink relative path)",
"directory traversal (via symlink double dots)",
"symlink path component exceeds 255 bytes",
"string exceeds reasonable limit (PURE_ZIP_STRING_MAX)",
"string contains a dangerous null byte",
"zip file could not be uncompressed",
"zip file could not be uncompressed (dictionary error)",
"zip file could not be uncompressed (stream error)",
"zip file could not be uncompressed (data error)",
"zip file could not be uncompressed (memory error)",
"compressed data is smaller than compressed size",
"uncompressed data is smaller than uncompressed size",
"file has a zero uncompressed size but a non-zero compressed size or invalid compressed data (ad nihilo)",
"file has a zero compressed size but a non-zero uncompressed size (ex nihilo)",
"file is corrupt or has an invalid crc32 checksum",
"zip64 end of central directory locator: overflow",
"zip64 end of central directory locator: bad signature",
"zip64 end of central directory locator: negative offset",
"zip64 end of central directory locator: disk != 0",
"zip64 end of central directory locator: disks > 1",
"zip64 end of central directory record: overflow",
"zip64 end of central directory record: bad signature",
"zip64 eocdr overlaps zip64 eocdl",
"gap between zip64 eocdr and zip64 eocdl (zeroed)",
"gap between zip64 eocdr and zip64 eocdl (buffer bleed)",
"eocdr diverges from zip64 eocdr: disk",
"eocdr diverges from zip64 eocdr: cd_disk",
"eocdr diverges from zip64 eocdr: cd_disk_records",
"eocdr diverges from zip64 eocdr: cd_records",
"eocdr diverges from zip64 eocdr: cd_size",
"eocdr diverges from zip64 eocdr: cd_offset",
"zip64 extended information extra field: missing compressed_size",
"zip64 extended information extra field: missing disk",
"zip64 extended information extra field: missing relative_offset",
"zip64 extended information extra field: missing uncompressed_size",
"zip64 extended information extra field: appended data (zeroed)",
"zip64 extended information extra field: appended data (buffer bleed)",
"zip64 extended information extra field: local file header must include both uncompressed_size and compressed_size",
"a directory has no local file header"
};