KeePass2Reader: fix error message logic #2523
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug found via lgtm.com.
Type of change
Description and Context
Fix error message when attempting to open a KeePass 1 database.
While I was at it, I also introduced a dedicated error message for I/O errors when attempting to read the file signature (though this is secondary and doesn't matter much).
Testing strategy
make test
continues to pass.Other than that, I've tested this manually, by attempting to open files
/dev/null
,CHANGELOG
, andtests/data/basic.kdb
.Before my change
The error message in all three cases is:
After my change
For
/dev/null
:For
CHANGELOG
:For
tests/data/basic.kdb
:Checklist:
-DWITH_ASAN=ON
. [REQUIRED]