[libgphoto2] Fix crash when dealing with PTP devices without a memory card (rhbz#915688)
Hans de Goede
jwrdegoede at fedoraproject.org
Sat May 4 09:24:58 UTC 2013
commit 9f458992d12573d95e71e3b98282569af82e5e5c
Author: Hans de Goede <hdegoede at redhat.com>
Date: Sat May 4 11:29:44 2013 +0200
Fix crash when dealing with PTP devices without a memory card (rhbz#915688)
libgphoto2-ptp-crash-on-no-card.patch | 17 +++++++++++++++++
libgphoto2.spec | 7 ++++++-
2 files changed, 23 insertions(+), 1 deletions(-)
---
diff --git a/libgphoto2-ptp-crash-on-no-card.patch b/libgphoto2-ptp-crash-on-no-card.patch
new file mode 100644
index 0000000..f309200
--- /dev/null
+++ b/libgphoto2-ptp-crash-on-no-card.patch
@@ -0,0 +1,17 @@
+http://sourceforge.net/p/gphoto/bugs/945/
+
+diff -up libgphoto2-2.5.1.1/camlibs/ptp2/ptp.c~ libgphoto2-2.5.1.1/camlibs/ptp2/ptp.c
+--- libgphoto2-2.5.1.1/camlibs/ptp2/ptp.c~ 2013-01-27 19:17:03.000000000 +0100
++++ libgphoto2-2.5.1.1/camlibs/ptp2/ptp.c 2013-05-04 11:21:32.558255859 +0200
+@@ -1877,6 +1877,11 @@ ptp_canon_eos_getobjectinfoex (
+ if (ret != PTP_RC_OK)
+ return ret;
+
++ if (!data) {
++ *nrofentries = 0;
++ return PTP_RC_OK;
++ }
++
+ *nrofentries = dtoh32a(data);
+ *entries = malloc(*nrofentries * sizeof(PTPCANONFolderEntry));
+ if (!*entries)
diff --git a/libgphoto2.spec b/libgphoto2.spec
index 8eed15f..f097014 100644
--- a/libgphoto2.spec
+++ b/libgphoto2.spec
@@ -2,7 +2,7 @@
Name: libgphoto2
Version: 2.5.1.1
-Release: 3%{?dist}
+Release: 4%{?dist}
Summary: Library for accessing digital cameras
Group: Development/Libraries
# GPLV2+ for the main lib (due to exif.c) and most plugins, some plugins GPLv2
@@ -14,6 +14,7 @@ Patch2: gphoto2-storage.patch
Patch3: gphoto2-ixany.patch
Patch4: gphoto2-device-return.patch
Patch5: libgphoto2-ptp-usb3.patch
+Patch6: libgphoto2-ptp-crash-on-no-card.patch
BuildRequires: libusb1-devel, libusb-devel >= 0.1.5
BuildRequires: lockdev-devel
BuildRequires: libexif-devel
@@ -57,6 +58,7 @@ use libgphoto2.
%patch3 -p1 -b .ixany
%patch4 -p1 -b .device-return
%patch5 -p1
+%patch6 -p1
for i in AUTHORS ChangeLog COPYING libgphoto2_port/AUTHORS libgphoto2_port/COPYING.LIB `find -name 'README.*'`; do
mv ${i} ${i}.old
@@ -159,6 +161,9 @@ cat libgphoto2*.lang >> %{name}.lang
%{_mandir}/man3/*
%changelog
+* Sat May 4 2013 Hans de Goede <hdegoede at redhat.com> - 2.5.1.1-4
+- Fix crash when dealing with PTP devices without a memory card (rhbz#915688)
+
* Thu May 2 2013 Hans de Goede <hdegoede at redhat.com> - 2.5.1.1-3
- Fix PTP devices not working in USB-3 ports (rhbz#819918)
- Cleanup spec-file
More information about the scm-commits
mailing list