~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to libclamav/dmg.c

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
#include <libxml/xmlreader.h>
50
50
#endif
51
51
 
 
52
#include <openssl/ssl.h>
 
53
#include <openssl/err.h>
 
54
#include "libclamav/crypto.h"
 
55
 
52
56
#include "cltypes.h"
53
57
#include "others.h"
54
58
#include "dmg.h"
168
172
    cli_dbgmsg("cli_scandmg: Extracting into %s\n", dirname);
169
173
 
170
174
    /* Dump XML to tempfile, if needed */
171
 
    if (ctx->engine->keeptmp && !ctx->engine->forcetodisk) {
 
175
    if (ctx->engine->keeptmp && !(ctx->engine->engine_options & ENGINE_OPTIONS_FORCE_TO_DISK)) {
172
176
        int xret;
173
177
        xret = dmg_extract_xml(ctx, dirname, &hdr);
174
178
 
180
184
    }
181
185
 
182
186
    /* scan XML with cli_map_scandesc */
183
 
    ret = cli_map_scan(*ctx->fmap, (off_t)hdr.xmlOffset, (size_t)hdr.xmlLength, ctx);
 
187
    ret = cli_map_scan(*ctx->fmap, (off_t)hdr.xmlOffset, (size_t)hdr.xmlLength, ctx, CL_TYPE_ANY);
184
188
    if (ret != CL_CLEAN) {
185
189
        cli_dbgmsg("cli_scandmg: retcode from scanning TOC xml: %s\n", cl_strerror(ret));
186
190
        if (!ctx->engine->keeptmp)
293
297
                if (ret == CL_EFORMAT) {
294
298
                    /* Didn't decode, or not a mish block */
295
299
                    ret = CL_CLEAN;
 
300
                    free(mish_set);
296
301
                    xmlFree(nodeName);
297
302
                    continue;
298
303
                }
299
304
                else if (ret != CL_CLEAN) {
300
305
                    xmlFree(nodeName);
 
306
                    free(mish_set);
301
307
                    continue;
302
308
                }
303
309
                /* Add mish block to list */
898
904
#endif
899
905
 
900
906
    cli_dbgmsg("dmg_stripe_bzip: stripe " STDu32 " initial len " STDu64 " expected len " STDu64 "\n",
901
 
            index, len, expected_len);
 
907
            index, (uint64_t)len, (uint64_t)expected_len);
902
908
 
903
909
#if HAVE_BZLIB_H
904
910
    memset(&strm, 0, sizeof(strm));