diff --git a/ChangeLog b/ChangeLog index cbea68030..310d101d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Thu May 26 14:17:52 CEST 2011 (acab) +------------------------------------ + * libclamav/matcher-hash.c: in hm_sort don't swap an item with itself (bb#2818) + Thu May 12 13:01:56 CEST 2011 (tk) ---------------------------------- * freshclam/manager.c: fix return code of Rfc2822DateTime() (bb#2809) diff --git a/libclamav/matcher-hash.c b/libclamav/matcher-hash.c index 907fee737..ed3a9f682 100644 --- a/libclamav/matcher-hash.c +++ b/libclamav/matcher-hash.c @@ -148,6 +148,7 @@ static void hm_sort(struct cli_sz_hash *szh, size_t l, size_t r, unsigned int ke while(l1 < r1) { if(hm_cmp(&szh->hash_array[keylen * l1], piv, keylen) > 0) { r1--; + if(l1 == r1) break; memcpy(tmph, &szh->hash_array[keylen * l1], keylen); tmpv = szh->virusnames[l1]; memcpy(&szh->hash_array[keylen * l1], &szh->hash_array[keylen * r1], keylen); diff --git a/libclamav/pdf.c b/libclamav/pdf.c index e544340c2..f40c7c77c 100644 --- a/libclamav/pdf.c +++ b/libclamav/pdf.c @@ -1314,6 +1314,8 @@ static void pdf_handle_enc(struct pdf_struct *pdf) if (pdf->enc_objid == ~0u || !pdf->fileID) return; obj = find_obj(pdf, pdf->objs, pdf->enc_objid); + if (!obj) + return; required_flags = (1 << OBJ_HASFILTERS) | (1 << OBJ_FILTER_STANDARD); if (!(obj->flags & required_flags)) return; @@ -1539,7 +1541,7 @@ int cli_pdf(const char *dir, cli_ctx *ctx, off_t offset) /* It is encrypted, and a password/key needs to be supplied to decrypt. * This doesn't trigger for PDFs that are encrypted but don't need * a password to decrypt */ - *ctx->virname = "Encrypted.PDF"; + *ctx->virname = "Heuristics.Encrypted.PDF"; rc = CL_VIRUS; }