diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-01 12:55:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-10-01 12:55:22 +0100 |
commit | a2342f217d549f06ceeabcf260ead8e9f88d6f7e (patch) | |
tree | 7c9c4145a93875bbcc6ca9f4245489a3722c7397 /src/libmime/archives.c | |
parent | c2c33134d46e3aa24f3b0aa387f9ae456af36ccd (diff) | |
download | rspamd-a2342f217d549f06ceeabcf260ead8e9f88d6f7e.tar.gz rspamd-a2342f217d549f06ceeabcf260ead8e9f88d6f7e.zip |
[Minor] Skip non-needed attributes in 7z
Diffstat (limited to 'src/libmime/archives.c')
-rw-r--r-- | src/libmime/archives.c | 47 |
1 files changed, 6 insertions, 41 deletions
diff --git a/src/libmime/archives.c b/src/libmime/archives.c index b37d3bf85..118da921c 100644 --- a/src/libmime/archives.c +++ b/src/libmime/archives.c @@ -1249,7 +1249,6 @@ rspamd_7zip_read_files_info (struct rspamd_task *task, struct rspamd_archive *arch) { guint64 nfiles = 0, sz, i; - guint num_defined = 0; guchar t, b; struct rspamd_archive_file *fentry; @@ -1271,49 +1270,15 @@ rspamd_7zip_read_files_info (struct rspamd_task *task, case kEmptyFile: case kAnti: /* AntiFile, OMFG */ /* We don't care about these bits */ - p = rspamd_7zip_read_bits (task, p, end, arch, nfiles, NULL); - break; case kCTime: case kATime: case kMTime: /* We don't care of these guys, but we still have to parse them, gah */ - /* - * BYTE AllAreDefined - * if (AllAreDefined == 0) - * { - * for(NumFiles) - * BIT TimeDefined - * } - * BYTE External; - * if(External != 0) - * UINT64 DataIndex - * [] - * for(Definded Items) - * UINT32 Time - * [] - */ - b = *p; /* All defined flag */ - SZ_SKIP_BYTES (1); - - if (b == 1) { - num_defined = nfiles; - } - else { - p = rspamd_7zip_read_bits (task, p, end, arch, nfiles, - &num_defined); - } - b = *p; /* External flag, gah */ - SZ_SKIP_BYTES (1); - - if (b) { - guint64 tmp; - - SZ_READ_VINT (tmp); + if (sz == 0) { + goto end; } else { - for (i = 0; i < num_defined; i ++) { - SZ_SKIP_BYTES (sizeof (guint32)); /* Real attr */ - } + SZ_SKIP_BYTES (sz); } break; case kName: @@ -1338,7 +1303,7 @@ rspamd_7zip_read_files_info (struct rspamd_task *task, while (tp < end - 1) { if (*tp == 0 && *(tp + 1) == 0) { - fend = tp + 2; + fend = tp; break; } @@ -1360,8 +1325,8 @@ rspamd_7zip_read_files_info (struct rspamd_task *task, else { msg_debug_task ("bad 7zip name; %s", G_STRLOC); } - - p = fend + 1; + /* Skip zero terminating character */ + p = fend + 2; } } break; |