Re: [xml] Possible malformation "bug" in libxml2



From veillard redhat com  Mon Jan 19 13:09:28 2004
Date: Mon, 19 Jan 2004 16:09:05 -0500
From: Daniel Veillard <veillard redhat com>
To: Regis Wilson <rwilson wmgnp tempdomainname com>
Cc: xml gnome org
Subject: Re: [xml] Possible malformation "bug" in libxml2

On Mon, Jan 19, 2004 at 11:44:48AM -0800, Regis Wilson wrote:
Solution offered!  See the original thread here:

This covers both cases of <html> and <body> (I hope?).  Comments, criticism,
testing, appreciated!

 Well, try sending a contextual diff, I can guess it may apply to HTMLparser.c
but I would not try betting on pure line numbers as the context...

My apologies.  I'm new to this forum.  diff -c format:

*** libxml2-2.6.4-new/HTMLparser.c  Mon Jan 19 10:52:07 2004
--- libxml2-2.6.4/HTMLparser.c  Thu Nov 20 13:54:34 2003
***************
*** 3237,3245 ****
        htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
                     "htmlParseStartTag: misplaced <html> tag\n",
                     name, NULL);
-         /* Dump the bogus tag like browsers do */
-         while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
-             NEXT;
        return;
      }
      if ((ctxt->nameNr != 1) &&
--- 3237,3242 ----
***************
*** 3247,3255 ****
        htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
                     "htmlParseStartTag: misplaced <head> tag\n",
                     name, NULL);
-         /* Dump the bogus tag like browsers do */
-         while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
-             NEXT;
        return;
      }
      if (xmlStrEqual(name, BAD_CAST"body")) {
--- 3244,3249 ----
***************
*** 3259,3267 ****
                htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
                             "htmlParseStartTag: misplaced <body> tag\n",
                             name, NULL);
!                 /* Dump the bogus tag like browsers do */
!                 while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
!                     NEXT;
                return;
            }
        }
--- 3253,3260 ----
                htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR,
                             "htmlParseStartTag: misplaced <body> tag\n",
                             name, NULL);
!               while ((IS_CHAR_CH(CUR)) && (CUR != '>'))
!                   NEXT;
                return;
            }
        }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]