~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to .pc/0005-libclamav-use-libmspack.patch/libclamav/chmunpack.h

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Extract component parts of MS CHM files
 
3
 *
 
4
 *  Copyright (C) 2007-2008 Sourcefire, Inc.
 
5
 *
 
6
 *  Authors: Trog
 
7
 *
 
8
 *  This program is free software; you can redistribute it and/or modify
 
9
 *  it under the terms of the GNU General Public License version 2 as
 
10
 *  published by the Free Software Foundation.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software
 
19
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
20
 *  MA 02110-1301, USA.
 
21
 */
 
22
 
 
23
#ifndef __CHM_UNPACK_H
 
24
#define __CHM_UNPACK_H
 
25
 
 
26
#if HAVE_CONFIG_H
 
27
#include "clamav-config.h"
 
28
#endif
 
29
 
 
30
#include "cltypes.h"
 
31
#include "others.h"
 
32
#include "fmap.h"
 
33
 
 
34
#ifndef HAVE_ATTRIB_PACKED
 
35
#define __attribute__(x)
 
36
#endif
 
37
 
 
38
#ifdef HAVE_PRAGMA_PACK
 
39
#pragma pack(1)
 
40
#endif
 
41
 
 
42
#ifdef HAVE_PRAGMA_PACK_HPPA
 
43
#pragma pack 1
 
44
#endif
 
45
 
 
46
#define CHM_ITSF_MIN_LEN (0x60)
 
47
typedef struct chm_itsf_header_tag
 
48
{
 
49
        unsigned char signature[4];
 
50
        int32_t version __attribute__ ((packed));
 
51
        int32_t header_len __attribute__ ((packed));
 
52
        uint32_t unknown __attribute__ ((packed));
 
53
        uint32_t last_modified __attribute__ ((packed));
 
54
        uint32_t lang_id __attribute__ ((packed));
 
55
        unsigned char dir_clsid[16];
 
56
        unsigned char stream_clsid[16];
 
57
        uint64_t sec0_offset __attribute__ ((packed));
 
58
        uint64_t sec0_len __attribute__ ((packed));
 
59
        uint64_t dir_offset __attribute__ ((packed));
 
60
        uint64_t dir_len __attribute__ ((packed));
 
61
        uint64_t data_offset __attribute__ ((packed));
 
62
} chm_itsf_header_t;
 
63
 
 
64
#define CHM_ITSP_LEN (0x54)
 
65
typedef struct chm_itsp_header_tag
 
66
{
 
67
        unsigned char signature[4];
 
68
        int32_t version __attribute__ ((packed));
 
69
        int32_t header_len __attribute__ ((packed));
 
70
        int32_t unknown1 __attribute__ ((packed));
 
71
        uint32_t block_len __attribute__ ((packed));
 
72
        int32_t blockidx_intvl __attribute__ ((packed));
 
73
        int32_t index_depth __attribute__ ((packed));
 
74
        int32_t index_root __attribute__ ((packed));
 
75
        int32_t index_head __attribute__ ((packed));
 
76
        int32_t index_tail __attribute__ ((packed));
 
77
        int32_t unknown2 __attribute__ ((packed));
 
78
        uint32_t num_blocks __attribute__ ((packed));
 
79
        uint32_t lang_id __attribute__ ((packed));
 
80
        unsigned char system_clsid[16];
 
81
        unsigned char unknown4[16];
 
82
} chm_itsp_header_t;
 
83
 
 
84
#ifdef HAVE_PRAGMA_PACK
 
85
#pragma pack()
 
86
#endif
 
87
 
 
88
#ifdef HAVE_PRAGMA_PACK_HPPA
 
89
#pragma pack
 
90
#endif
 
91
 
 
92
typedef struct chm_sys_entry_tag
 
93
{
 
94
        uint64_t offset;
 
95
        uint64_t length;
 
96
} chm_sys_entry_t;
 
97
 
 
98
typedef struct chm_metadata_tag {
 
99
        uint64_t file_length;
 
100
        uint64_t file_offset;
 
101
        chm_sys_entry_t sys_control;
 
102
        chm_sys_entry_t sys_content;
 
103
        chm_sys_entry_t sys_reset;
 
104
        off_t m_length;
 
105
        chm_itsf_header_t itsf_hdr;
 
106
        chm_itsp_header_t itsp_hdr;
 
107
        int ufd;
 
108
        int ofd;
 
109
        uint32_t num_chunks;
 
110
        off_t chunk_offset;
 
111
        const char *chunk_data;
 
112
        const char *chunk_current;
 
113
        const char *chunk_end;
 
114
        fmap_t *map;
 
115
        uint16_t chunk_entries;
 
116
} chm_metadata_t;
 
117
 
 
118
int cli_chm_open(const char *dirname, chm_metadata_t *metadata, cli_ctx *ctx);
 
119
int cli_chm_prepare_file(chm_metadata_t *metadata);
 
120
int cli_chm_extract_file(char *dirname, chm_metadata_t *metadata, cli_ctx *ctx);
 
121
void cli_chm_close(chm_metadata_t *metadata);
 
122
#endif