Skip to content

fix(server): prevent ZeroDivisionError on empty zip archive validation#147

Open
Pratikshya32 wants to merge 1 commit into
Akshay473:mainfrom
Pratikshya32:fix-zip-zero-division
Open

fix(server): prevent ZeroDivisionError on empty zip archive validation#147
Pratikshya32 wants to merge 1 commit into
Akshay473:mainfrom
Pratikshya32:fix-zip-zero-division

Conversation

@Pratikshya32
Copy link
Copy Markdown

This pull request resolves a potential server crash when processing empty ZIP archives.

Changes

  • Implemented a division-by-zero check inside _validate_zip_archive (in Server/security.py) to fall back to 1.0 if total_compressed is 0.
  • This ensures empty ZIP files do not raise a ZeroDivisionError and crash the server.

Closes #146

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

Someone is attempting to deploy a commit to the akshay473's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: ZeroDivisionError in _validate_zip_archive when verifying empty zip archive

1 participant