Skip to content

KdbxReader::readDatabase: abort if reading magic numbers fails#1641

Merged
phoerious merged 1 commit intokeepassxreboot:developfrom
tycho:lto-fixup
Mar 5, 2018
Merged

KdbxReader::readDatabase: abort if reading magic numbers fails#1641
phoerious merged 1 commit intokeepassxreboot:developfrom
tycho:lto-fixup

Conversation

@tycho
Copy link
Copy Markdown
Contributor

@tycho tycho commented Mar 5, 2018

Building with -flto caught the fact that we were ignoring the return
value of readMagicNumbers(), which potentially left the value of 'sig2'
uninitialized.

Building with -flto caught the fact that we were ignoring the return
value of readMagicNumbers(), which potentially left the value of 'sig2'
uninitialized.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
@TheZ3ro TheZ3ro requested a review from a team March 5, 2018 17:40
@TheZ3ro TheZ3ro added the bug label Mar 5, 2018
@TheZ3ro TheZ3ro added this to the v2.3.1 milestone Mar 5, 2018
@phoerious phoerious added file format and removed bug labels Mar 5, 2018
@phoerious
Copy link
Copy Markdown
Member

phoerious commented Mar 5, 2018

The only way that can ever happen is if the file stream ends after less than 8 byte. But in order to satisfy pedantic people, we may as well check it.

@phoerious phoerious merged commit 8397473 into keepassxreboot:develop Mar 5, 2018
@phoerious phoerious modified the milestones: v2.3.1, v2.4.0 Mar 5, 2018
@tycho
Copy link
Copy Markdown
Contributor Author

tycho commented Mar 5, 2018

@phoerious Yep, I agree it's unlikely. But it -is- theoretically possible and it makes the compiler happy. We could also just initialize sig1/sig2 to arbitrary values to satisfy the compiler.

@tycho tycho deleted the lto-fixup branch March 6, 2018 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants