DevToys-app / DevToys-app/DevToys

App crash when generating passwords with a large list of excluded characters

Open
#1,663 2 comments 0 reactions 0 assignees View on GitHub
app-kind:GUI bug platforms:Windows untriaged
Dominant language
C#
Stars
32k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

### Current behavior

The application exhibits two distinct issues depending on the "Exclude characters" input:

Total Crash: When providing a long list of specific characters to exclude (e.g., @, :, /, %, &, ?, #, +, !, $, ^, *), the application crashes immediately upon clicking "Generate password(s)".

Incorrect Output: When using a shorter exclusion filter such as ^, *, the generator fails to produce a random string and instead returns only strings of asterisks (*) regardless of the configured password length.

### How to reproduce it (as minimally and precisely as possible)

Scenario 1: App Crash
1. Open the Password Generator tool.
2. Set Password Length to 36.
3. Enable all character toggles (Lowercase, Uppercase, Digits, Special Characters).
4. In the "Exclude the following characters..." field, paste: @, :, /, %, &, ?, #, +, !, $, ^, *
5. Click "Generate password(s)".
6. The app closes/crashes instantly.

Scenario 2: Logic Failure (Asterisk Loop)
1. Use the same settings as above.
2. Change the exclusion field to: ^, *
3. Click "Generate password(s)".
4. The output field fills with lines containing only ************************************.

### Expected behavior

The app should handle excluded characters without crashing, even if the list is long.

If the exclusion list is valid, the generator should return a random string of characters that are not in the exclusion list, while still respecting the requested password length.

If an exclusion list makes it impossible to generate a password (e.g., excluding all possible characters), the app should show a validation error instead of crashing or returning a broken string.

### Screenshots

Image

Image

### Workaround

_No response_

### Affected platforms

Windows

### Affected DevToys kind

DevToys (app with GUI)

### DevToys Version

Versão 1.0.14.0 | X64 | RELEASE | 3ad0ff2d | 3ad0ff2d

### Relevant Assets/Logs

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.