Merge branch 'dbus-1.6'

Conflicts:
	NEWS
This commit is contained in:
Simon McVittie 2013-04-22 16:16:03 +01:00
commit 5f12e6e081
3 changed files with 9 additions and 11 deletions

4
NEWS
View file

@ -10,6 +10,10 @@ Configuration changes:
Fixes:
• Following Unicode Corrigendum #9, the noncharacters U+nFFFE, U+nFFFF,
U+FDD0..U+FDEF are allowed in UTF-8 strings again.
(fd.o #63072, Simon McVittie)
• Diagnose incorrect use of dbus_connection_get_data() with negative slot
(i.e. before allocating the slot) rather than returning junk
(fd.o #63127, Dan Williams)

View file

@ -1577,19 +1577,11 @@ _dbus_string_split_on_byte (DBusString *source,
*
* The second check covers surrogate pairs (category Cs).
*
* The last two checks cover "Noncharacter": defined as:
* "A code point that is permanently reserved for
* internal use, and that should never be interchanged. In
* Unicode 3.1, these consist of the values U+nFFFE and U+nFFFF
* (where n is from 0 to 10_16) and the values U+FDD0..U+FDEF."
*
* @param Char the character
*/
#define UNICODE_VALID(Char) \
((Char) < 0x110000 && \
(((Char) & 0xFFFFF800) != 0xD800) && \
((Char) < 0xFDD0 || (Char) > 0xFDEF) && \
((Char) & 0xFFFE) != 0xFFFE)
(((Char) & 0xFFFFF800) != 0xD800))
/**
* Finds the given substring in the string,

View file

@ -178,12 +178,14 @@ const char * const invalid_single_signatures[] = {
const char * const valid_strings[] = {
"",
"\xc2\xa9",
"\xc2\xa9", /* UTF-8 (c) symbol */
"\xef\xbf\xbe", /* U+FFFE is reserved but Corrigendum 9 says it's OK */
NULL
};
const char * const invalid_strings[] = {
"\xa9",
"\xa9", /* Latin-1 (c) symbol */
"\xed\xa0\x80", /* UTF-16 surrogates are not valid in UTF-8 */
NULL
};