Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
xml parser: skip UTF-8 BOM header, fixes #2644
  • Loading branch information
perexg committed Jan 27, 2015
1 parent b98e688 commit 3c0a279
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/htsmsg_xml.c
Expand Up @@ -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;

Expand Down

0 comments on commit 3c0a279

Please sign in to comment.