... | ... |
@@ -1,3 +1,7 @@ |
1 |
+Wed May 19 13:15:06 EEST 2010 (edwin) |
|
2 |
+------------------------------------- |
|
3 |
+ * libclamav/pdf.c: bb #2016 |
|
4 |
+ |
|
1 | 5 |
Wed May 19 00:03:19 CEST 2010 (tk) |
2 | 6 |
---------------------------------- |
3 | 7 |
* libclamav/readdb.c: properly reject .info files passed on cmdline (bb#2025) |
... | ... |
@@ -451,10 +451,12 @@ cli_pdf(const char *dir, cli_ctx *ctx, off_t offset) |
451 | 451 |
} |
452 | 452 |
if(ret) { |
453 | 453 |
unsigned char *t; |
454 |
+ unsigned size; |
|
454 | 455 |
|
455 | 456 |
real_streamlen = ret; |
456 | 457 |
/* free unused trailing bytes */ |
457 |
- t = (unsigned char *)cli_realloc(tmpbuf,calculated_streamlen); |
|
458 |
+ size = real_streamlen > calculated_streamlen ? real_streamlen : calculated_streamlen; |
|
459 |
+ t = (unsigned char *)cli_realloc(tmpbuf,size); |
|
458 | 460 |
if(t == NULL) { |
459 | 461 |
free(tmpbuf); |
460 | 462 |
close(fout); |