]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
xml parser: skip UTF-8 BOM header, fixes #2644
authorJaroslav Kysela <perex@perex.cz>
Tue, 27 Jan 2015 10:48:03 +0000 (11:48 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 27 Jan 2015 10:48:03 +0000 (11:48 +0100)
src/htsmsg_xml.c

index d1ba7d5f368142e04c3f4a22a24d2c0667c76cb4..81ff53ca28051a58a738d8a268ec6a058ea292e3 100644 (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;