~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/mpool.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
#if HAVE_STRING_H
36
36
#include <string.h>
37
37
#endif
 
38
#if defined(HAVE_MMAP) && defined(HAVE_SYS_MMAN_H)
38
39
#include <sys/mman.h>
 
40
#endif
39
41
#include <stddef.h>
40
42
 
41
43
#include "others.h"
203
205
};
204
206
 
205
207
struct FRAG {
 
208
#ifdef CL_DEBUG
 
209
  unsigned int magic;
 
210
#endif
206
211
  union {
207
212
    struct FRAG *next;
208
213
    unsigned int sbits;
 
214
    int64_t dummy_align;
 
215
    /* needed to align to 64-bit on sparc, since pointers are 32-bit only,
 
216
     * yet we need 64-bit alignment for struct containing int64 members */
209
217
  } u;
210
 
#ifdef CL_DEBUG
211
 
  unsigned int magic;
212
 
#endif
213
218
  void *fake;
214
219
};
215
220
#define FRAG_OVERHEAD (offsetof(struct FRAG, fake))
453
458
    return NULL;
454
459
}
455
460
 
456
 
unsigned char *cli_mpool_hex2str(mpool_t *mp, const unsigned char *hex) {
 
461
unsigned char *cli_mpool_hex2str(mpool_t *mp, const char *hex) {
457
462
    unsigned char *str;
458
463
    size_t len = strlen((const char*)hex);
459
464
 
523
528
  len = strlen(hex);
524
529
 
525
530
  if(len % 2 != 0) {
526
 
    cli_errmsg("cli_hex2si(): Malformed hexstring: %s (length: %u)\n", hex, len);
 
531
    cli_errmsg("cli_mpool_hex2ui(): Malformed hexstring: %s (length: %u)\n", hex, len);
527
532
    return NULL;
528
533
  }
529
534