Cisco-Talos / clamav

ClamAV - Documentation is here: https://docs.clamav.net
https://www.clamav.net/
GNU General Public License v2.0
4.43k stars 706 forks source link

PDF scan fails with particular PDF #1333

Closed alexzeitgeist closed 3 months ago

alexzeitgeist commented 3 months ago

Describe the bug

A particular PDF file cannot be scanned with clamav. The following error occurs:

clamav-1  | LibClamAV Error: pdf_extract_obj: can't create temporary file /tmp/20240815_121615-clamsmtpd.OPMkpg.6bb1fd3610/clamsmtpd.OPMkpg.286cc89e71/_root_personalblatt_logo_hfe.pdf.7a44f2b420/pdf-tmp.99c16273bf/pdf obj 338 0: File exists
clamav-1  | LibClamAV Error: pdf_extract_obj: can't create temporary file /tmp/20240815_121615-clamsmtpd.OPMkpg.6bb1fd3610/clamsmtpd.OPMkpg.286cc89e71/clamav-ace7fbfbf7b6f6a6f76140938105cc7e.tmp.7938d93a07/pdf-tmp.c4382207ce/pdf obj 338 0: File exists
clamav-1  | Thu Aug 15 12:16:15 2024 -> /var/spool/clamsmtp/clamsmtpd.OPMkpg: Can't create temporary file ERROR

It seems it tries to extract an object that already exists with the same name?

This PDF was generated with the Adobe PDF Library 19.10.96. Any other files, PDF and other formats, can be scanned.

alexzeitgeist commented 3 months ago

Closing this issue. It was caused by me having LeaveTemporaryFiles set to yes during setting up clamav. Didn't expect it to cause issues during scans.

micahsnyder commented 3 months ago

@alexzeitgeist that's interesting. Still a bug, but not one that affects most people. 🤔