Bug #425

KeePassX 2.0 and GitHub master crash when trying to import a .kdb file

Added by Igor Krivenko about 3 years ago. Updated about 3 years ago.

Target version:
Operating System:
Affected version:
Affected revision:


I discovered a crash in the 'Import KeePass 1 database' function. It occurs immediately after entering the correct master password.
I analyzed the crash using GDB (a full backtrace is attached) and came to a conclusion that it is caused by an integer overflow in KeePass1Reader::parseCustomIcons4().
Not sure, if this is a real bug or a consequence of my .kdb file being broken. Anyway, application of a simple patch (see attachment) allowed me to successfully import the database.

keepassx-bt.txt Magnifier - GDB full backtrace (8.29 KB) Igor Krivenko, 01/31/2016 03:38 PM

parse_custom_icons4.patch Magnifier - Possible fix (1.4 KB) Igor Krivenko, 01/31/2016 03:39 PM

Associated revisions

Revision c14d04b3
Added by Felix Geyer about 3 years ago

Fix crash when icon id is larger than INT_MAX.

In these cases icon id was interpreted as a negative number.
The QList access with a negative index resulted in a crash.


#1 Updated by Felix Geyer about 3 years ago

  • Target version set to 2.0.1

Thanks for the patch!

The icon ids in your database indeed look broken since the ids are a sequential number of icons in the database.
It's still a bug in the parsing code of course.

#2 Updated by Felix Geyer about 3 years ago

  • Status changed from New to Closed

Also available in: Atom PDF