Skip to content

Fix arithmetic overflow in Test-PasswordQuality with empty dictionary…#221

Merged
MichaelGrafnetter merged 1 commit intomasterfrom
claude/charming-thompson
Mar 24, 2026
Merged

Fix arithmetic overflow in Test-PasswordQuality with empty dictionary…#221
MichaelGrafnetter merged 1 commit intomasterfrom
claude/charming-thompson

Conversation

@MichaelGrafnetter
Copy link
Copy Markdown
Owner

… file

The ReportProgress method would divide by zero when fileLength was 0. Add an early return when fileLength <= 0 to prevent the division.

Fixes #219

… file

The ReportProgress method would divide by zero when fileLength was 0.
Add an early return when fileLength <= 0 to prevent the division.

Fixes #219

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 24, 2026 20:21
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses an OverflowException in Test-PasswordQuality progress reporting by preventing a divide-by-zero/overflow scenario when the input file length is 0 (empty file), aligning with issue #219.

Changes:

  • Add an early return in ReportProgress when fileLength <= 0 (or when position >= fileLength) to avoid invalid progress calculation.
  • Ensure progress is marked as completed (PercentComplete = 100) and written before returning.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MichaelGrafnetter MichaelGrafnetter merged commit b0dbfcc into master Mar 24, 2026
5 checks passed
@MichaelGrafnetter MichaelGrafnetter deleted the claude/charming-thompson branch March 24, 2026 23:07
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]: Arithmetic Overflow Exception in

2 participants