Skip to content

Commit

Permalink
Prevent encrypting with an empty password
Browse files Browse the repository at this point in the history
  • Loading branch information
kenkendk committed Jul 5, 2024
1 parent dc660a1 commit 366ffc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/EncryptingStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public EncryptingStreamInternal(string password, Stream stream, EncryptionOption
//Basic input checks
if (stream == null)
throw new ArgumentNullException("stream");
if (password == null)
if (string.IsNullOrWhiteSpace(password))
throw new ArgumentNullException("password");
if (!stream.CanWrite)
throw new ArgumentException("The stream must be writeable", "stream");
Expand Down

0 comments on commit 366ffc3

Please sign in to comment.