1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

fixed a XML Namespace compliance bug reported by Alexander Grimalovsky

* parser.c: fixed a XML Namespace compliance bug reported by
  Alexander Grimalovsky
Daniel
This commit is contained in:
Daniel Veillard
2002-10-16 18:02:47 +00:00
parent 44892f73dd
commit bb284f4453
2 changed files with 25 additions and 1 deletions

View File

@ -1688,11 +1688,30 @@ xmlSplitQName(xmlParserCtxtPtr ctxt, const xmlChar *name, xmlChar **prefix) {
if (c == ':') {
c = *cur++;
c = *cur;
if (c == 0) return(ret);
*prefix = ret;
len = 0;
/*
* Check that the first character is proper to start
* a new name
*/
if (!(((c >= 0x61) && (c <= 0x7A)) ||
((c >= 0x41) && (c <= 0x5A)) ||
(c == '_') || (c == ':'))) {
int l;
int first = CUR_SCHAR(cur, l);
if (!IS_LETTER(first) && (first != '_')) {
if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
ctxt->sax->error(ctxt->userData,
"Name %s is not XML Namespace compliant\n",
name);
}
}
cur++;
while ((c != 0) && (len < max)) { /* tested bigname2.xml */
buf[len++] = c;
c = *cur++;