xml parser: skip UTF-8 BOM header, fixes #2644

This commit is contained in:
Jaroslav Kysela 2015-01-27 11:48:03 +01:00
parent b98e688f57
commit 3c0a279825

View file

@ -833,6 +833,10 @@ htsmsg_xml_deserialize(char *src, char *errbuf, size_t errbufsize)
xp.xp_encoding = XML_ENCODING_UTF8;
LIST_INIT(&xp.xp_namespaces);
/* check for UTF-8 BOM */
if(src[0] == 0xef && src[1] == 0xbb && src[2] == 0xbf)
memmove(src, src + 3, strlen(src) - 2);
if((src = htsmsg_parse_prolog(&xp, src)) == NULL)
goto err;