vstoykov / django-clamd

Integrates python-clamd with Django for easy scanning files for viruses on upload
17 stars 33 forks source link

Check for empty / Null files #18

Closed maksym3d closed 9 months ago

maksym3d commented 9 months ago

The validator appears to throw an exception when the submitted file is null - since a null / non-existing file is not an infected file, I would suggest wrapping the initial seek(0) with a try/except:

# Check if the file is not empty / exists
try:
    file.seek(0)
except:
    return
vstoykov commented 9 months ago

Fixed in #19