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

« back to all changes in this revision

Viewing changes to libclamav/swf.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:
44
44
#include <time.h>
45
45
#include <zlib.h>
46
46
 
 
47
#include <openssl/ssl.h>
 
48
#include <openssl/err.h>
 
49
#include "libclamav/crypto.h"
 
50
 
47
51
#include "cltypes.h"
48
52
#include "swf.h"
49
53
#include "clamav.h"
59
63
        bitbuf = (unsigned int) get_c;                                          \
60
64
        offset += sizeof(get_c);                                                \
61
65
    } else {                                                                    \
62
 
        cli_errmsg("cli_scanswf: INITBITS: Can't read file\n");                 \
 
66
        cli_warnmsg("cli_scanswf: INITBITS: Can't read file or file truncated\n");      \
63
67
        return CL_EFORMAT;                                                      \
64
68
    }                                                                           \
65
69
}
76
80
            bitpos = 8;                                                         \
77
81
            offset += sizeof(get_c);                                            \
78
82
        } else {                                                                \
79
 
            cli_errmsg("cli_scanswf: GETBITS: Can't read file\n");              \
 
83
            cli_warnmsg("cli_scanswf: GETBITS: Can't read file or file truncated\n");   \
80
84
            return CL_EFORMAT;                                                  \
81
85
        }                                                                       \
82
86
    }                                                                           \
92
96
        getword_1 = (unsigned int) get_c;                                       \
93
97
        offset += sizeof(get_c);                                                \
94
98
    } else {                                                                    \
95
 
        cli_errmsg("cli_scanswf: GETWORD: Can't read file\n");                  \
 
99
        cli_warnmsg("cli_scanswf: GETWORD: Can't read file or file truncated\n");       \
96
100
        return CL_EFORMAT;                                                      \
97
101
    }                                                                           \
98
102
    if(fmap_readn(map, &get_c, offset, sizeof(get_c)) == sizeof(get_c)) {       \
99
103
        getword_2 = (unsigned int) get_c;                                       \
100
104
        offset += sizeof(get_c);                                                \
101
105
    } else {                                                                    \
102
 
        cli_errmsg("cli_scanswf: GETWORD: Can't read file\n");                  \
 
106
        cli_warnmsg("cli_scanswf: GETWORD: Can't read file or file truncated\n");       \
103
107
        return CL_EFORMAT;                                                      \
104
108
    }                                                                           \
105
109
    v = (uint16_t)(getword_1 & 0xff) | ((getword_2 & 0xff) << 8);               \
296
300
        cli_dbgmsg("SWF: %s\n", pt ? pt : "UNKNOWN TAG");
297
301
        cli_dbgmsg("SWF: Tag length: %u\n", tag_len);
298
302
        if (tag_len > map->len) {
299
 
            cli_warnmsg("SWF: Invalid tag length.\n");
 
303
            cli_dbgmsg("SWF: Invalid tag length.\n");
300
304
            return CL_EFORMAT;
301
305
        }
302
306
        if ((offset + tag_len) < offset) {