~ubuntu-branches/ubuntu/oneiric/clamav/oneiric-updates

« back to all changes in this revision

Viewing changes to libclamav/cache.c

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Seth Arnold, Scott Kitterman
  • Date: 2013-04-25 23:41:55 UTC
  • mfrom: (114.1.2 oneiric-security)
  • Revision ID: package-import@ubuntu.com-20130425234155-5e19oj23w5sm7n4v
Tags: 0.97.8+dfsg-1ubuntu1.11.10.1
[ Seth Arnold ]
* SECURITY UPDATE: Updated to 0.97.8 to fix multiple security issues.
  - CVE-2013-2020 and CVE-2013-2021

[ Scott Kitterman ]
* Merge from Debian unstable (LP: #1172981).  Remaining changes:
  - Drop build-dep on electric-fence (in Universe)
  - Add apparmor profiles for clamd and freshclam along with maintainer
    script changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
688
688
}
689
689
 
690
690
/* Hashes a file onto the provided buffer and looks it up the cache.
691
 
   Returns CL_VIRUS if found, CL_CLEAN if not FIXME or an error */
 
691
   Returns CL_VIRUS if found, CL_CLEAN if not FIXME or a recoverable error,
 
692
   and returns CL_EREAD if unrecoverable */
692
693
int cache_check(unsigned char *hash, cli_ctx *ctx) {
693
694
    fmap_t *map;
694
695
    size_t todo, at = 0;
709
710
            return CL_EREAD;
710
711
        todo -= readme;
711
712
        at += readme;
712
 
        cli_md5_update(&md5, buf, readme);
 
713
        if (cli_md5_update(&md5, buf, readme)) {
 
714
            cli_errmsg("cache_check: error reading while generating hash!\n");
 
715
            return CL_EREAD;
 
716
        }
713
717
    }
714
718
    cli_md5_final(hash, &md5);
715
719
    ret = cache_lookup_hash(hash, map->len, ctx->engine->cache, ctx->recursion);