~ubuntu-branches/ubuntu/raring/clamav/raring

« back to all changes in this revision

Viewing changes to libclamav/lzma_iface.c

  • Committer: Bazaar Package Importer
  • Author(s): Stephen Gran
  • Date: 2008-09-05 17:25:34 UTC
  • mfrom: (0.35.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080905172534-yi3f8fkye1o7u1r3
* New upstream version (closes: #497662, #497773)
  - lots of new options for clamd.conf
  - fixes CVEs CVE-2008-3912, CVE-2008-3913, CVE-2008-3914, and
    CVE-2008-1389
* No longer supports --unzip option, so typo is gone (closes: #496276)
* Translations:
  - sv (thanks Martin Bagge <brother@bsnet.se>) (closes: #491760)

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
 
129
129
  return res;
130
130
}
 
131
 
 
132
int cli_LzmaInitUPX(CLI_LZMA **Lp, uint32_t dictsz) {
 
133
  CLI_LZMA *L = *Lp;
 
134
 
 
135
  if(!L) {
 
136
    *Lp = L = cli_calloc(sizeof(*L), 1);
 
137
    if(!L) {
 
138
      return LZMA_RESULT_DATA_ERROR;
 
139
    }
 
140
  }
 
141
 
 
142
  L->state.Properties.pb = 2; /* FIXME: these  */
 
143
  L->state.Properties.lp = 0; /* values may    */
 
144
  L->state.Properties.lc = 3; /* not be static */
 
145
 
 
146
  L->state.Properties.DictionarySize = dictsz;
 
147
 
 
148
  if (!(L->state.Probs = (CProb *)cli_malloc(LzmaGetNumProbs(&L->state.Properties) * sizeof(CProb))))
 
149
    return LZMA_RESULT_DATA_ERROR;
 
150
 
 
151
  if (!(L->state.Dictionary = (unsigned char *)cli_malloc(L->state.Properties.DictionarySize))) {
 
152
    free(L->state.Probs);
 
153
    return LZMA_RESULT_DATA_ERROR;
 
154
  }
 
155
 
 
156
  L->initted = 1;
 
157
 
 
158
  LzmaDecoderInit(&L->state);
 
159
  return LZMA_RESULT_OK;
 
160
}