rpms/bluez/devel bluez-sdp-xml-with-nulls.patch, NONE, 1.1 bluez.spec, 1.45, 1.46

Bastien Nocera hadess at fedoraproject.org
Fri Mar 6 01:06:37 UTC 2009


Author: hadess

Update of /cvs/pkgs/rpms/bluez/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30201

Modified Files:
	bluez.spec 
Added Files:
	bluez-sdp-xml-with-nulls.patch 
Log Message:
* Fri Mar 06 2009 - Bastien Nocera <bnocera at redhat.com> - 4.32-5
- Fix SDP parsing to XML when it contains NULLs


bluez-sdp-xml-with-nulls.patch:

--- NEW FILE bluez-sdp-xml-with-nulls.patch ---
diff --git a/common/sdp-xml.c b/common/sdp-xml.c
index 0403dcd..5f314b7 100644
--- a/common/sdp-xml.c
+++ b/common/sdp-xml.c
@@ -239,9 +239,7 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
 		hex = 0;
 
 		for (i = 0; i < length; i++) {
-			if (value->val.str[i] == '\0')
-				break;
-			if (!isprint(value->val.str[i])) {
+			if (!isprint(value->val.str[i]) && value->val.str[i] != '\0') {
 				hex = 1;
 				break;
 			}
@@ -250,7 +248,8 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
 			if ((value->val.str[i] == '<') ||
 					(value->val.str[i] == '>') ||
 					(value->val.str[i] == '"') ||
-					(value->val.str[i] == '&'))
+					(value->val.str[i] == '&') ||
+					(value->val.str[i] == '\0'))
 				num_chars_to_escape++;
 		}
 
@@ -304,7 +303,13 @@ static void convert_raw_data_to_xml(sdp_data_t *value, int indent_level,
 					strBuf[j++] = 'o';
 					strBuf[j++] = 't';
 				}
-				else {
+				else if (value->val.str[i] == '\0') {
+					strBuf[j++] = '&';
+					strBuf[j++] = '#';
+					strBuf[j++] = '0';
+					strBuf[j++] = '0';
+					strBuf[j++] = ';';
+				} else {
 					strBuf[j++] = value->val.str[i];
 				}
 			}


Index: bluez.spec
===================================================================
RCS file: /cvs/pkgs/rpms/bluez/devel/bluez.spec,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- bluez.spec	5 Mar 2009 18:53:13 -0000	1.45
+++ bluez.spec	6 Mar 2009 01:06:07 -0000	1.46
@@ -1,7 +1,7 @@
 Summary: Bluetooth utilities
 Name: bluez
 Version: 4.32
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv2+
 Group: Applications/System
 Source: http://www.kernel.org/pub/linux/bluetooth/%{name}-%{version}.tar.gz
@@ -12,6 +12,8 @@
 # https://bugzilla.redhat.com/show_bug.cgi?id=450081
 # http://thread.gmane.org/gmane.linux.bluez.kernel/1687
 Patch2: bluez-try-utf8-harder.patch
+# http://thread.gmane.org/gmane.linux.bluez.kernel/1688
+Patch3: bluez-sdp-xml-with-nulls.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 URL: http://www.bluez.org/
@@ -99,6 +101,7 @@
 %setup -q
 %patch1 -p0 -b .oui
 %patch2 -p1 -b .non-utf8-name
+%patch3 -p1 -b .nulls-in-sdp-text
 
 %build
 %configure --enable-cups --enable-hid2hci --enable-dfutool --enable-tools --enable-bccmd --enable-gstreamer --enable-hidd --enable-pand --enable-dund
@@ -191,6 +194,9 @@
 %{_libdir}/alsa-lib/*.so
 
 %changelog
+* Fri Mar 06 2009 - Bastien Nocera <bnocera at redhat.com> - 4.32-5
+- Fix SDP parsing to XML when it contains NULLs
+
 * Thu Mar 05 2009 - Bastien Nocera <bnocera at redhat.com> - 4.32-4
 - Work-around broken devices that export their names in ISO-8859-1
   (#450081)




More information about the fedora-extras-commits mailing list