Add patch to avoid multi-byte characters from being stripped

from the device name
This commit is contained in:
Bastien Nocera 2013-02-21 08:48:47 +01:00
parent 3c49e9d260
commit c69ea0c181
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,27 @@
From 060e3f2683ed2b0b08e1a31deb9608a99e193b4a Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <teuf@gnome.org>
Date: Tue, 26 Jun 2012 00:03:30 +0200
Subject: [PATCH] property_list_service: do not strip non-ASCII characters from
XML plists
'content' is declared as char content[] so if char is signed, all characters with the high bit set will be negative so they will be < 0x20. This means the code will strip all non-ASCII (multi-byte) UTF-8 characters and replace them with spaces. This commit fixes it now by really only considering ASCII characters.
---
src/property_list_service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/property_list_service.c b/src/property_list_service.c
index 8634864..c9a8edf 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -250,7 +250,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
} else {
/* iOS 4.3+ hack: plist data might contain invalid characters, thus we convert those to spaces */
for (bytes = 0; bytes < pktlen-1; bytes++) {
- if ((content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d))
+ if ((content[bytes] >= 0) && (content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d))
content[bytes] = 0x20;
}
plist_from_xml(content, pktlen, plist);
--
1.8.1.2

View File

@ -6,7 +6,7 @@
Name: libimobiledevice
Version: 1.1.4
Release: 5%{?dist}
Release: 6%{?dist}
Summary: Library for connecting to mobile devices
Group: System Environment/Libraries
@ -31,6 +31,7 @@ Obsoletes: libimobiledevice-python < %{version}-%{release}
%endif
Patch0: 0001-Don-t-crash-if-HOME-is-empty.patch
Patch1: 0001-property_list_service-do-not-strip-non-ASCII-charact.patch
%description
libimobiledevice is a library for connecting to mobile devices including phones
@ -55,6 +56,7 @@ Python bindings for libimobiledevice.
%prep
%setup -q
%patch0 -p1 -b .empty-home
%patch1 -p1 -b .multi-byte-name
# Fix dir permissions on html docs
chmod +x docs/html
@ -98,6 +100,10 @@ find %{buildroot} -name '*.la' -exec rm -f {} ';'
%endif
%changelog
* Thu Feb 21 2013 Bastien Nocera <bnocera@redhat.com> 1.1.4-6
- Add patch to avoid multi-byte characters from being stripped
from the device name
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.4-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild