~ubuntu-branches/ubuntu/maverick/clamav/maverick-security

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/Bitcode/BitstreamWriter.h

  • Committer: Bazaar Package Importer
  • Author(s): Marc Deslauriers
  • Date: 2011-02-23 14:27:51 UTC
  • mfrom: (0.35.17 sid)
  • Revision ID: james.westby@ubuntu.com-20110223142751-o9xb8jyvhkh75d0n
Tags: 0.96.5+dfsg-1ubuntu1.10.10.2
* SECURITY UPDATE: denial of service via double free in vba processing
  - libclamav/vba_extract.c: set buf to NULL when it gets freed.
  - http://git.clamav.net/gitweb?p=clamav-devel.git;a=commit;h=d21fb8d975f8c9688894a8cef4d50d977022e09f
  - CVE-2011-1003

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
  //===--------------------------------------------------------------------===//
89
89
 
90
90
  void Emit(uint32_t Val, unsigned NumBits) {
91
 
    assert(NumBits <= 32 && "Invalid value size!");
 
91
    assert(NumBits && NumBits <= 32 && "Invalid value size!");
92
92
    assert((Val & ~(~0U >> (32-NumBits))) == 0 && "High bits set!");
93
93
    CurValue |= Val << CurBit;
94
94
    if (CurBit + NumBits < 32) {
277
277
    switch (Op.getEncoding()) {
278
278
    default: assert(0 && "Unknown encoding!");
279
279
    case BitCodeAbbrevOp::Fixed:
280
 
      Emit((unsigned)V, (unsigned)Op.getEncodingData());
 
280
      if (Op.getEncodingData())
 
281
        Emit((unsigned)V, (unsigned)Op.getEncodingData());
281
282
      break;
282
283
    case BitCodeAbbrevOp::VBR:
283
 
      EmitVBR64(V, (unsigned)Op.getEncodingData());
 
284
      if (Op.getEncodingData())
 
285
        EmitVBR64(V, (unsigned)Op.getEncodingData());
284
286
      break;
285
287
    case BitCodeAbbrevOp::Char6:
286
288
      Emit(BitCodeAbbrevOp::EncodeChar6((char)V), 6);