Bug 340672 - Kompare crashes (SIGSEGV) when comparing directories with space in path names
Summary: Kompare crashes (SIGSEGV) when comparing directories with space in path names
Status: RESOLVED FIXED
Alias: None
Product: kompare
Classification: Applications
Component: general (show other bugs)
Version: 4.1.3
Platform: Fedora RPMs Linux
: NOR crash
Target Milestone: ---
Assignee: Kompare developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-06 04:32 UTC by Syam
Modified: 2015-05-10 22:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Set of files to reproduce the problem (231 bytes, application/x-gzip)
2014-11-06 04:32 UTC, Syam
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Syam 2014-11-06 04:32:15 UTC
I am trying to compare two directories that have spaces in path names, kompare crashes.
Eg: "/some/path having spaces/dir1" and "/some/path having spaces/dir2"

I am attaching a simple st of files. Test by comparing the directories file1 & file2.

Reproducible: Always

Steps to Reproduce:
1. Extract the attachment
2. Compare "kompare test/file1" and "kompare test/file2"
3. Observe the crash
Comment 1 Syam 2014-11-06 04:32:48 UTC
Created attachment 89468 [details]
Set of files to reproduce the problem
Comment 2 Syam 2014-11-06 04:33:48 UTC
Here's the bug report for Fedora (auto reported by abrt):
https://bugzilla.redhat.com/show_bug.cgi?id=1160938

The report says it could be potential duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1033186

I have observed the latter bug while comparing Qwt sources.
Comment 3 Daimonion 2015-05-08 17:32:02 UTC
This happens with latest Kompare (15.04.0) too, if it can help, here's a backtrace:

http://p.pomf.se/7362
Comment 4 David Rosca 2015-05-10 22:05:30 UTC
Git commit d5220095efd768435628bdbcc28c52014b2f9dc9 by David Rosca.
Committed on 10/05/2015 at 22:04.
Pushed by drosca into branch 'master'.

Fix crash when comparing files with space in path

Add functions to escape/unescape paths extracted from diffs:
 - remove quotes if path is enclosed in quotes (in case of space in path)
 - unescape quotes in path (in case path actually contains quote)
 - unescape double backquotes (not on Windows)
REVIEW: 123698

M  +3    -2    diffmodel.cpp
M  +40   -4    parserbase.cpp
M  +3    -0    parserbase.h

http://commits.kde.org/libkomparediff2/d5220095efd768435628bdbcc28c52014b2f9dc9