From: Vsevolod Stakhov Date: Fri, 11 Jan 2019 15:06:52 +0000 (+0000) Subject: [Minor] Archives: More fixes to 7zip parsing X-Git-Tag: 1.9.0~339 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b5917e6cb15b22342db93593611e61b2e667d699;p=rspamd.git [Minor] Archives: More fixes to 7zip parsing --- diff --git a/src/libmime/archives.c b/src/libmime/archives.c index 110ce9417..34c529a64 100644 --- a/src/libmime/archives.c +++ b/src/libmime/archives.c @@ -995,7 +995,7 @@ end: static const guchar * rspamd_7zip_read_folder (struct rspamd_task *task, const guchar *p, const guchar *end, - struct rspamd_archive *arch, guint *pnstreams) + struct rspamd_archive *arch, guint *pnstreams, guint *ndigests) { guint64 ncoders = 0, i, j, noutstreams = 0, ninstreams = 0; @@ -1086,6 +1086,7 @@ rspamd_7zip_read_folder (struct rspamd_task *task, } *pnstreams = noutstreams; + (*ndigests) += npacked; return p; } @@ -1149,9 +1150,7 @@ rspamd_7zip_read_coders_info (struct rspamd_task *task, for (i = 0; i < num_folders && p != NULL && p < end; i++) { p = rspamd_7zip_read_folder (task, p, end, arch, - &folder_nstreams[i]); - - num_digests += folder_nstreams[i]; + &folder_nstreams[i], &num_digests); } } break;