diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-05-09 12:35:11 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-05-09 12:35:11 +0200 |
commit | d3e2e1243bb0dae95ce35b0380dd4f8f476b254d (patch) | |
tree | 8779ad6b2059f181770cc07e2437925d7d5d5d04 /strings | |
parent | 229dad1f9b12f8e9f64b6a605bdf8e31c339d018 (diff) | |
parent | 124428a9e28e59f98b25d8ee07b57d264f63cbe4 (diff) | |
download | mariadb-git-d3e2e1243bb0dae95ce35b0380dd4f8f476b254d.tar.gz |
5.5 merge
Diffstat (limited to 'strings')
-rw-r--r-- | strings/xml.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/strings/xml.c b/strings/xml.c index 8073b881a47..4685a04faec 100644 --- a/strings/xml.c +++ b/strings/xml.c @@ -286,7 +286,7 @@ static void mstr(char *s,const char *src,size_t l1, size_t l2) static int my_xml_leave(MY_XML_PARSER *p, const char *str, size_t slen) { - char *e; + char *e, *tag; size_t glen; char s[32]; char g[32]; @@ -295,13 +295,14 @@ static int my_xml_leave(MY_XML_PARSER *p, const char *str, size_t slen) /* Find previous '/' or beginning */ for (e= p->attr.end; (e > p->attr.start) && (e[0] != '/') ; e--); glen= (size_t) ((e[0] == '/') ? (p->attr.end - e - 1) : p->attr.end - e); + tag= e[0] == '/' ? e + 1 : e; - if (str && (slen != glen)) + if (str && (slen != glen || memcmp(str, tag, slen))) { mstr(s,str,sizeof(s)-1,slen); if (glen) { - mstr(g,e+1,sizeof(g)-1,glen), + mstr(g, tag, sizeof(g)-1, glen); sprintf(p->errstr,"'</%s>' unexpected ('</%s>' wanted)",s,g); } else |