Bug 344495

Summary: Crash upon importing search results with no database open
Product: [Applications] KBibTeX Reporter: Arseniy Lartsev <receive-spam>
Component: Network/online searchAssignee: Thomas Fischer <fischer>
Status: RESOLVED FIXED    
Severity: crash    
Priority: NOR    
Version First Reported In: git (master)   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Suggested fix
The same patch against 0.5.1

Description Arseniy Lartsev 2015-02-23 18:00:54 UTC
Created attachment 91249 [details]
Suggested fix

A great program, by the way! But I've stumbled upon this little bug here. I'd like to point out that after encountering this crash, I first though that it made the program completely unusable for me. I know that it's not actually the case, but that was my first impression, and it's very important that the program doesn't make that kind first impression on the users.

SearchResultsPrivate::mainEditor is initialized with some garbage upon startup when no database is open. As a result, SearchResults::updateGUI doesn't disable the import button because this garbage isn't NULL. Clicking this import button then leads to a crash.
Comment 1 Arseniy Lartsev 2015-02-23 18:13:24 UTC
One more thing that came to my mind was https://bugs.kde.org/show_bug.cgi?id=344497
Comment 2 Arseniy Lartsev 2015-02-23 18:43:27 UTC
Created attachment 91252 [details]
The same patch against 0.5.1
Comment 3 Thomas Fischer 2015-03-07 15:08:31 UTC
Git commit 853796f9fc0312dac92169dda6dac022473c8442 by Thomas Fischer.
Committed on 07/03/2015 at 15:01.
Pushed by thomasfischer into branch 'kbibtex/0.5'.

Uninitialized variable causes crash -- fixed

As reported by Arseniy Lartsev, there was an uninitialized
variable in SearchResultsPrivate's constructor.
Due to being uninitialized, KBibTeX could be crashed by
clicking on the Import button if no search had been conducted
earlier.

Patch 91252 by A.L. has been applied with minor modifications.
Thanks!

M  +1    -1    src/program/docklets/searchresults.cpp

http://commits.kde.org/kbibtex/853796f9fc0312dac92169dda6dac022473c8442