"Settings" dialog causes segfault when \n exists in .git/config

Bug #1221748 reported by Abhijit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qgit (Ubuntu)
New
Undecided
Unassigned

Bug Description

I'm running QGit version 2.3 compiled against Qt 4.8.2.
Each time i go to edit > settings, qgit segfaults. I'm running GNOME, but another machine running KDE does not seem to have this problem. Can't seem to find a verbose or debug mode anywhere either, so not sure how to isolate the source of the problem!

Tags: git segfault
Revision history for this message
Abhijit (abhijit86k) wrote :

So did quite a bit of digging up and it turns out its a very specific problem - Qgit will crash is you open the settings dialog for a repo in which the config file has a branch description has \n in the non-terminal location in a line. Will shortly post snippets to reproduce the bug.

summary: - Segfault when opening the "Settings" dialog
+ "Settings" dialog causes segfault when \n exists in .git/config
Revision history for this message
Abhijit (abhijit86k) wrote :

Commands to reproduce bug:
cd /tmp/ #or any temporary directory
mkdir qgitbugreproduce; cd qgitbugreproduce
git init
touch test; git add test; git commit -m "initial commit" # Just a test commit to create something for qgit to show

git branch --edit-description
#In the editor that opens, type one lineof text "Master branch"

qgit &
#Go to Edit > Settings . Dialog opens, no problem.
#Close Qgit

#Now to crash Qgit:

git branch --edit-description
#In the editor that opens, add a line of text below what we entered earlier, so it should now look like this:

        Master Branch
        This will crash QGit
        # Please edit the description for the branch
        # master
        # Lines starting with '#' will be stripped.

#Open Qgit with
qgit

#and try to open settings dialog
#You should get a segfault.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.