Bug 298811 - camera:/ crashes on devices with / in names
Summary: camera:/ crashes on devices with / in names
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: kamera (show other bugs)
Version: unspecified
Platform: Debian unstable Linux
: NOR crash
Target Milestone: ---
Assignee: Marcus Meissner
URL:
Keywords:
: 302115 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-04-25 14:19 UTC by Andrey Rakhmatullin
Modified: 2013-04-21 22:41 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.10


Attachments
quote/unquote path components (4.99 KB, patch)
2012-06-20 21:32 UTC, Marcus Meissner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrey Rakhmatullin 2012-04-25 14:19:42 UTC
I have a device that has "GT-P7310/P7510/N7000/I9100/Galaxy Tab 7.7/10.1/S2/Nexus/Note" as a name in libgphoto2. camera:/ initially shows a folder with this name, when I try to open it kio_kamera dies.

==21617== Invalid read of size 8
==21617==    at 0x402B672: memmove (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21617==    by 0x4F8797C: QListData::remove(int) (string3.h:58)
==21617==    by 0x4F87C8A: QListData::erase(void**) (qlist.cpp:412)
==21617==    by 0xD50042E: KameraProtocol::split_url2camerapath(QString, QString&, QString&) (qlist.h:453)
==21617==    by 0xD502FCE: KameraProtocol::listDir(KUrl const&) (kamera.cpp:550)
==21617==    by 0x4BCE088: KIO::SlaveBase::dispatch(int, QByteArray const&) (slavebase.cpp:1092)
==21617==    by 0x4BC8A25: KIO::SlaveBase::dispatchLoop() (slavebase.cpp:295)
==21617==    by 0xD4FE9F6: kdemain (kamera.cpp:84)
==21617==    by 0x400E07: main (kioslave.cpp:155)
==21617==  Address 0xde5ff58 is 8 bytes before a block of size 40 alloc'd
==21617==    at 0x402894D: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21617==    by 0x4F87280: QListData::detach_grow(int*, int) (qlist.cpp:85)
==21617==    by 0x4F824E8: QList<QString>::detach_helper_grow(int, int) (qlist.h:666)
==21617==    by 0x4F825E0: QList<QString>::append(QString const&) (qlist.h:497)
==21617==    by 0x4FAF01B: QString::split(QChar const&, QString::SplitBehavior, Qt::CaseSensitivity) const (qstring.cpp:6092)
==21617==    by 0xD5002BF: KameraProtocol::split_url2camerapath(QString, QString&, QString&) (kamera.cpp:410)
==21617==    by 0xD502FCE: KameraProtocol::listDir(KUrl const&) (kamera.cpp:550)
==21617==    by 0x4BCE088: KIO::SlaveBase::dispatch(int, QByteArray const&) (slavebase.cpp:1092)
==21617==    by 0x4BC8A25: KIO::SlaveBase::dispatchLoop() (slavebase.cpp:295)
==21617==    by 0xD4FE9F6: kdemain (kamera.cpp:84)
==21617==    by 0x400E07: main (kioslave.cpp:155)

I've rebuilt libgphoto2 changing the name in camlibs/ptp2/music-players.h to just "Nexus", the folder is now named "Samsung Nexus" and it can be opened.

Reproducible: Always
Comment 1 Philipp A. 2012-05-24 16:28:40 UTC
I can confirm the crash with a device that’s listed with this slash-containing name. My device is a Samsung Galaxy S2 with Cyanogenmod 9 nighly on it.
Comment 2 Marcus Meissner 2012-05-25 07:02:20 UTC
i can confirm this problem.

I am adding more quoting/unquoting to the kioslave :/
Comment 3 Marcus Meissner 2012-06-20 07:38:03 UTC
*** Bug 302115 has been marked as a duplicate of this bug. ***
Comment 4 Marcus Meissner 2012-06-20 21:32:32 UTC
Created attachment 72002 [details]
quote/unquote path components

The patch i tried to apply to GIT ...

(I pushed it but it does not show up on the gitweb page)
Comment 5 skolima 2012-08-09 19:13:34 UTC
I'd like to confirm both the problem (kamera 4.8.3) and that applying the patch fixes it.
Comment 6 Andrey Rakhmatullin 2012-08-23 10:07:54 UTC
Confirming that the patch works with 4.8.4 and Galaxy Nexus.
Comment 7 Christoph Feck 2013-04-21 22:41:31 UTC
The commit is in 4.10 branch and master at least.