After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 716252 - [gphoto] importing long filename from camera crashes Shotwell
[gphoto] importing long filename from camera crashes Shotwell
Status: RESOLVED FIXED
Product: shotwell
Classification: Other
Component: general
unspecified
Other All
: Urgent normal
: ---
Assigned To: Jim Nelson
Shotwell Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-04-30 09:06 UTC by Adam Dingle
Modified: 2013-05-01 06:40 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Charles Lindsay 2013-11-25 21:44:30 UTC


---- Reported by adam@yorba.org 2010-04-30 14:06:00 -0700 ----

Original Redmine bug id: 1851
Original URL: http://redmine.yorba.org/issues/1851
Searchable id: yorba-bug-1851
Original author: Adam Dingle
Original description:

A Fedora user reports that importing from the Nexus One crashes Shotwell:

https://bugzilla.redhat.com/show_bug.cgi?id=585676

It turns out this crash will happen any time a camera contains a long
filename.



---- Additional Comments From shotwell-maint@gnome.bugs 2013-05-01 11:40:00 -0700 ----

### History

####

#1

Updated by Jim Nelson over 3 years ago

Looking over the stack trace, the crash is occurring in gPhoto2. We call
gp_get_camera_file_info with a folder of

`//maps/mymaps/icons`

and a filename of

`http%3A%2F%2Fmaps.google.com%2Fmapfiles%2Fkml%2Fpaddle%2Fblu-circle_maps.png`

The call resolves down to get_info_func whose call parameters are the proper
filename but the folder pointer is set to -1. This causes strcpy to explode.

More investigation would be required. The odd folder name suggests that's the
problem. (Samba's UNC?)

####

#2

Updated by Jim Nelson over 3 years ago

The bug is due to the long filename being strcpy'd into a fixed-size buffer.
The solution is not trivial, as a "proper" solution would affect gPhoto2's
interface.  The gPhoto2 ticket is here:

[https://sourceforge.net/tracker/?func=detail&aid=3000198&group_id=8874&atid=1
08874](https://sourceforge.net/tracker/?func=detail&aid=3000198&group_id=8874&
atid=108874)

####

#3

Updated by Adam Dingle over 3 years ago

  * **Subject** changed from _import from Nexus One crashes Shotwell_ to _importing long filename from camera crashes Shotwell_

####

#4

Updated by Adam Dingle over 3 years ago

  * **Subject** changed from _importing long filename from camera crashes Shotwell_ to _[gphoto] importing long filename from camera crashes Shotwell_

Until the problem is fixed in gPhoto2, can we guard against it in Shotwell by
explicitly ignoring filenames which are too long?

####

#5

Updated by Jim Nelson over 3 years ago

That is probably the only solution. Even if gPhoto does fix this, we'll need
to guard against it until the release is disseminated.

####

#6

Updated by Jim Nelson over 3 years ago

  * **Status** changed from _Open_ to _Review_
  * **Assignee** changed from _Anonymous_ to _Jim Nelson_

####

#7

Updated by Jim Nelson over 3 years ago

I've committed a patch which should catch the long filenames and skip them
before calling gPhoto methods which perform unchecked strcpy's. Will work with
downstream reporter to see if this fixes it.

####

#8

Updated by Jim Nelson over 3 years ago

  * **Status** changed from _Review_ to _5_
  * **Resolution** set to _fixed_
  * **% Done** set to _100_

My own tests say this is fixed. If not, please re-open.

####

#9

Updated by Jim Nelson about 2 years ago

  * **Description** updated (diff)


####

#10

Updated by Charles Lindsay 7 months ago

  * **Status** changed from _5_ to _Fixed_



--- Bug imported by chaz@yorba.org 2013-11-25 21:44 UTC  ---

This bug was previously known as _bug_ 1851 at http://redmine.yorba.org/show_bug.cgi?id=1851

Unknown Component 
   Using default product and component set in Parameters 
Unknown version " in product shotwell. 
   Setting version to "!unspecified".
Unknown milestone "unknown in product shotwell. 
   Setting to default milestone for this product, "---".
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.