1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-13 13:17:36 +03:00
Commit Graph

432 Commits

Author SHA1 Message Date
Finn Barber
fe6890e292 Fix htmlReadFd, which was using a mix of xml and html context functions 2022-01-16 15:31:54 +01:00
David King
e7d1c53a49 Fix memory leak in xmlFreeParserInputBuffer
Found by Coverity.

https://bugzilla.redhat.com/show_bug.cgi?id=1938806
2022-01-16 14:10:34 +01:00
Nick Wellnhofer
798bdf13f6 Different approach to fix quadratic behavior in HTML push parser
The old approach introduced a regression, see issue #312 and the
previous commit. Disable code that tries to recover from invalid start
tags. This only affects "recovery" mode.

Add a comment outlining a better fix in accordance with the HTML5 spec.
2022-01-10 14:50:20 +01:00
Nick Wellnhofer
094fc08a09 Fix regression when parsing invalid HTML tags in push mode
Revert part of commit 173a0830 that changed behavior when parsing
malformed start tags with the push parser. This reintroduces quadratic
behavior in recovery mode which will be worked around in the next
commit.

Fixes #312.
2022-01-10 14:49:00 +01:00
Nick Wellnhofer
2732b23466 Fix regression parsing public IDs literals in HTML
Fix regression introduced when reworking htmlParsePubidLiteral in
commit 93ce33c2.

Fixes #318.
2022-01-10 13:37:59 +01:00
Nick Wellnhofer
7279d23636 Fix htmlTagLookup
Fix regression introduced with b25acce8. Some users like libxslt may
call the HTML output functions on documents with uppercase tag names,
so we must keep case-insensitive string comparison.

Fixes #248.
2021-05-06 10:54:29 +02:00
Nick Wellnhofer
683de7efe4 Fix duplicate xmlStrEqual calls in htmlParseEndTag 2021-03-04 19:22:35 +01:00
Nick Wellnhofer
8095365b77 Speed up htmlCheckAutoClose
Switch to binary search.
2021-03-04 19:22:35 +01:00
Nick Wellnhofer
b25acce858 Speed up htmlTagLookup
Switch to binary search. This is the first time bsearch is used in the
libxml2 code base. But it's a standard library function since C89 and
should be portable.
2021-03-04 17:44:45 +01:00
Nick Wellnhofer
0fb3ae5840 Revert "Improve HTML fuzzer stability"
This reverts commit de1b51eddc.
2021-02-22 17:31:05 +01:00
Nick Wellnhofer
de1b51eddc Improve HTML fuzzer stability
Call htmlInitAutoClose during fuzzer initialization to fix stability
issue. Leave a note concerning problems with this function.
2021-02-22 13:21:38 +01:00
Nick Wellnhofer
dcb80b92da Fix slow parsing of HTML with encoding errors
Under certain circumstances, the HTML parser would try to guess and
switch input encodings multiple times, leading to slow processing of
documents with encoding errors. The repeated scanning of the input
buffer when guessing encodings could even lead to quadratic behavior.

The code htmlCurrentChar probably assumed that if there's an encoding
handler, it is guaranteed to produce valid UTF-8. This holds true in
general, but if the detected encoding was "UTF-8", the UTF8ToUTF8
encoding handler simply invoked memcpy without checking for invalid
UTF-8. This still must be fixed, preferably by not using this handler
at all.

Also leave a note that switching encodings twice seems impossible to
implement correctly. Add a check when handling UTF-8 encoding errors
in htmlCurrentChar to avoid this situation, even if encoders produce
invalid UTF-8.

Found by OSS-Fuzz.
2021-02-20 21:28:56 +01:00
Nick Wellnhofer
954696e7cf Fix infinite loop in HTML parser introduced with recent commits
Check for XML_PARSER_EOF to avoid an infinite loop introduced with
recent changes to the HTML push parser.

Found by OSS-Fuzz.
2021-02-07 14:38:55 +01:00
Mike Dalessio
a67b63d183 use new htmlParseLookupCommentEnd to find comment ends
Note that the caret in error messages generated during comment parsing
may have moved by one byte.

See guidance provided on incorrectly-closed comments here:

https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment
2020-12-16 16:12:07 +01:00
Mike Dalessio
29f5d20e84 htmlParseComment: treat --!> as if it closed the comment
See guidance provided on incorrectly-closed comments here:

https://html.spec.whatwg.org/multipage/parsing.html#parse-error-incorrectly-closed-comment
2020-12-16 16:12:07 +01:00
Nick Wellnhofer
94c2e415a9 Fix quadratic runtime in HTML push parser with null bytes
Null bytes in the input stream do not necessarily signal an EOF
condition. Check the stream pointers for EOF to avoid quadratic
rescanning of input data.

Note that the CUR_CHAR macro used in functions like htmlParseCharData
calls htmlCurrentChar which translates null bytes.

Found by OSS-Fuzz.
2020-12-06 16:44:11 +01:00
Nick Wellnhofer
438e595a8c Stop counting nbChars in parser context
The value was inaccurate and never used.
2020-08-09 15:01:45 +02:00
Nick Wellnhofer
f6a9541fb8 Remove unneeded progress checks in HTML parser
The HTML parser should now be guaranteed to make progress, so the
checks became unnecessary.
2020-08-09 14:54:37 +02:00
Nick Wellnhofer
93ce33c2b8 Fix several quadratic runtime issues in HTML push parser
Fix a few remaining cases where the HTML push parser would scan more
content during lookahead than being parsed later.

Make sure that htmlParseDocTypeDecl consumes all content up to the
final '>' in case of errors. The old comment said "We shouldn't try to
resynchronize", but ignoring invalid content is also what the HTML5
spec mandates.

Likewise, make htmlParseEndTag skip to the final '>' in invalid end
tags even if not in recovery mode. This is probably the most visible
change in practice and leads to different output for some tests but is
also more in line with HTML5.

Make sure that htmlParsePI and htmlParseComment don't abort if invalid
characters are encountered but log an error and ignore the character.

Change some other end-of-buffer checks to test for a zero byte instead
of relying on IS_CHAR.

Fix usage of IS_CHAR macro in htmlParseScript.
2020-07-23 20:47:35 +02:00
Nick Wellnhofer
173a0830dc Fix quadratic runtime when push parsing HTML start tags
Make sure that htmlParseStartTag doesn't terminate on characters for
which IS_CHAR_CH is false like control chars.

In htmlParseTryOrFinish, only switch to START_TAG if the next character
starts a valid name. Otherwise, htmlParseStartTag might return without
consuming all characters up to the final '>'.

Found by OSS-Fuzz.
2020-07-22 23:33:04 +02:00
Nick Wellnhofer
6995eed077 Fix quadratic runtime when push parsing HTML entity refs
The HTML push parser would look ahead for characters in "; >/" to
terminate an entity reference but actual parsing could stop earlier,
potentially resulting in quadratic runtime.

Parse char data and references alternately in htmlParseTryOrFinish
and only look ahead once for a terminating '<' character.

Found by OSS-Fuzz.
2020-07-19 14:05:57 +02:00
Nick Wellnhofer
8e219b154e Fix HTML push parser lookahead
The parsing rules when looking for terminating chars or sequences in
the push parser differed from the actual parsing code. This could
result in the lookahead to overshoot and data being rescanned,
potentially leading to quadratic runtime.

Comments must never be handled during lookahead. Attribute values must
only be skipped for start tags and doctype declarations, not for end
tags, comments, PIs and script content.
2020-07-15 16:44:36 +02:00
Nick Wellnhofer
e050062ca9 Make htmlCurrentChar always translate U+0000
The general assumption is that htmlCurrentChar only returns 0 if the
end of the input buffer is reached. The UTF-8 path already logged an
error if a zero byte U+0000 was found and returned a space character
instead. Make the ASCII code path do the same.

htmlParseTryOrFinish skips zero bytes at the beginning of a buffer, so
even if 0 was returned from htmlCurrentChar, the push parser would make
progress. But rescanning the input could cause performance problems.

The pull parser would abort parsing and now handles zero bytes in ASCII
mode the same way as the push parser or as in UTF-8 mode.

It would be better to return the replacement character U+FFFD instead,
but some of the client code assumes that the UTF-8 length of input and
output matches.
2020-07-15 16:10:13 +02:00
Nick Wellnhofer
dfd4e33048 Rework control flow in htmlCurrentChar
Don't call xmlCurrentChar after switching encodings. Rearrange code
blocks and fall through to normal UTF-8 handling.
2020-07-15 16:10:13 +02:00
Nick Wellnhofer
1493130ef2 Fix UTF-8 decoder in HTML parser
Reject sequences starting with a continuation byte as well as overlong
sequences like the XML parser.

Also fixes an infinite loop in connection with previous commit 50078922
since htmlCurrentChar would return 0 even if not at the end of the
buffer.

Found by OSS-Fuzz.
2020-07-15 12:54:25 +02:00
Nick Wellnhofer
500789224b Fix quadratic runtime when parsing HTML script content
If htmlParseScript returns upon hitting an invalid character,
htmlParseLookupSequence will be called again with checkIndex reset to
zero, potentially resulting in quadratic runtime. Make sure that
htmlParseScript consumes all input in one go and simply skips over
invalid characters similar to htmlParseCharDataInternal.

Found by OSS-Fuzz.
2020-07-13 12:19:24 +02:00
Nick Wellnhofer
3f18e7486d Reset HTML parser input before reporting error
Avoid use-after-free, similar to 13ba5b61. Also make sure that
xmlBufSetInputBaseCur sets valid pointers in case of buffer errors.

Found by OSS-Fuzz.
2020-07-11 14:39:52 +02:00
Nick Wellnhofer
3da8d947df Fix more quadratic runtime issues in HTML push parser
Make sure that checkIndex is set when returning without match from
inside a comment. Also track parser state in htmlParseLookupChars.

Found by OSS-Fuzz.
2020-07-09 16:08:38 +02:00
Nick Wellnhofer
741b0d0a8b Fix regression introduced with 477c7f6a
The 'inSubset' member is actually used by the SAX2 handlers. Store
extra parser state in 'hasPErefs'.
2020-07-07 12:57:01 +02:00
Nick Wellnhofer
477c7f6aff Fix quadratic runtime in HTML parser
Commit eeb99329 removed an important optimization avoiding quadratic
runtime when repeatedly scanning the input buffer for terminating
characters in the HTML push parser. The related bug is

    https://bugzilla.gnome.org/show_bug.cgi?id=444994

Make sure that ctxt->checkIndex is always written and store additional
parser state in ctxt->inSubset which is unused in the HTML parser.

Found by OSS-Fuzz.
2020-07-06 12:17:20 +02:00
Nick Wellnhofer
13ba5b619a Reset HTML parser input before reporting encoding error
If charset conversion fails, reset the input pointers before reporting
the error and bailing out. Otherwise, the input pointers are left in an
invalid state which could lead to use-after-free and other memory
errors.

Similar to f9e7997e. Found by OSS-Fuzz.
2020-06-28 13:21:50 +02:00
Nick Wellnhofer
681f094e5b Fix unsigned integer overflow in htmlParseTryOrFinish
Cast to signed type before subtraction to avoid unsigned integer
overflow. Also use ptrdiff_t to avoid potential integer truncation.

Found with libFuzzer and UBSan.
2020-06-15 21:25:22 +02:00
Nick Wellnhofer
31ca4a728c Fix integer overflow in htmlParseCharRef
Fixes #115.
2020-06-15 21:23:54 +02:00
Nick Wellnhofer
20c60886e4 Fix typos
Resolves #133.
2020-03-08 17:41:53 +01:00
Nick Wellnhofer
f9f8df0a31 Fix uninitialized memory access in HTML parser
The SAX2 character handler expects NULL-terminated buffer.

Closes #106.

Also see https://github.com/lxml/lxml/pull/288
2019-10-14 16:39:21 +02:00
Jared Yanovich
2a350ee9b4 Large batch of typo fixes
Closes #109.
2019-09-30 18:04:38 +02:00
Nick Wellnhofer
dbc6b55b59 Fix warnings when compiling without reader or push parser 2019-05-16 21:06:56 +02:00
Nick Wellnhofer
60173c821e Reset HTML parser input pointers on encoding failure
Call xmlBufResetInput before bailing out if switching the encoding
fails. Otherwise, the input pointers could be left in an invalid state.

Similar to commit f9e7997e80 for the
XML parser.

Thanks to Yunho Kim for the report.

Closes: #27
2018-09-11 14:08:39 +02:00
Daniel Veillard
35e8348850 HTML noscript should not close p
For https://bugzilla.gnome.org/show_bug.cgi?id=795343

- HTMLparser.c: noscript should not close <p> but it should close <script>
2018-04-18 16:04:27 +02:00
Nick Wellnhofer
7a1bd7f649 Revert "Change calls to xmlCharEncInput to set flush false"
This reverts commit 6e6ae5daa6 which
broke decoding of larger documents with ICU.

See https://bugs.chromium.org/p/chromium/issues/detail?id=820163
2018-03-17 00:03:24 +01:00
Joel Hockey
6e6ae5daa6 Change calls to xmlCharEncInput to set flush false when not final call. Having flush incorrectly set to true causes errors for ICU. 2018-01-08 19:57:53 +01:00
Nick Wellnhofer
cb5541c9f3 Fix libz and liblzma detection
If libz or liblzma are detected with pkg-config, AC_CHECK_HEADERS must
not be run because the correct CPPFLAGS aren't set. It is actually not
required have separate checks for LIBXML_ZLIB_ENABLED and HAVE_ZLIB_H.
Only check for LIBXML_ZLIB_ENABLED and remove HAVE_ZLIB_H macro.

Fixes bug 764657, bug 787041.
2017-11-27 14:33:37 +01:00
Nick Wellnhofer
e03f0a199a Fix hash callback signatures
Make sure that all parameters and return values of hash callback
functions exactly match the callback function type. This is required
to pass clang's Control Flow Integrity checks and to allow compilation
to asm.js with Emscripten.

Fixes bug 784861.
2017-11-09 16:42:47 +01:00
Nick Wellnhofer
576912fa04 Make HTML parser functions take const pointers
The 'cur' parameter of htmlParseDoc and htmlSAXParseDoc should be
'const xmlChar *'.

Fixes bug 770650.
2017-06-17 15:59:13 +02:00
Nick Wellnhofer
0b2d5c48e3 Initialize keepBlanks in HTML parser
This caused failures in the HTML push tests but the fix required to
change the expected output of the HTML SAX tests.
2017-06-12 19:11:54 +02:00
Nick Wellnhofer
9a366a3748 Fix compiler warning in htmlParseElementInternal 2017-06-11 12:43:59 +02:00
Nick Wellnhofer
f39e3be0dd Fix sanity check in htmlParseNameComplex
- (cur - len) can overflow.
- Throw an internal error.

Fixes bug 780077.
2017-06-11 12:43:37 +02:00
Pranjal Jumde
11ed4a7a90 Heap use-after-free in htmlParsePubidLiteral and htmlParseSystemiteral
For https://bugzilla.gnome.org/show_bug.cgi?id=760263

* HTMLparser.c: Add BASE_PTR convenience macro.
(htmlParseSystemLiteral): Store length and start position instead
of a pointer while iterating through the public identifier since
the underlying buffer may change, resulting in a stale pointer
being used.
(htmlParsePubidLiteral): Ditto.
2016-05-23 15:01:07 +08:00
David Kilzer
4472c3a5a5 Fix some format string warnings with possible format string vulnerability
For https://bugzilla.gnome.org/show_bug.cgi?id=761029

Decorate every method in libxml2 with the appropriate
LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups
following the reports.
2016-05-23 15:01:07 +08:00
Hugh Davenport
beca86e8c8 Detect change of encoding when parsing HTML names
From https://bugzilla.gnome.org/show_bug.cgi?id=758518

Happens when a file has a name getting parsed, but no valid encoding
set, so libxml has to guess what the encoding is. This patch detects
when the buffer location changes, and if it does, restarts the parsing
of the name.

This slightly change a couple of regression tests output
2016-05-23 15:01:07 +08:00
Pranjal Jumde
a820dbeac2 Bug 758605: Heap-based buffer overread in xmlDictAddString <https://bugzilla.gnome.org/show_bug.cgi?id=758605>
Reviewed by David Kilzer.

* HTMLparser.c:
(htmlParseName): Add bounds check.
(htmlParseNameComplex): Ditto.
* result/HTML/758605.html: Added.
* result/HTML/758605.html.err: Added.
* result/HTML/758605.html.sax: Added.
* runtest.c:
(pushParseTest): The input for the new test case was so small
(4 bytes) that htmlParseChunk() was never called after
htmlCreatePushParserCtxt(), thereby creating a false positive
test failure.  Fixed by using a do-while loop so we always call
htmlParseChunk() at least once.
* test/HTML/758605.html: Added.
2016-05-23 15:01:07 +08:00
Jan Pokorný
bb654feb9a Fix typos: dictio{ nn -> n }ar{y,ies}
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2016-04-15 22:22:48 +08:00
Hugh Davenport
8fb4a77007 CVE-2015-8242 Buffer overead with HTML parser in push mode
For https://bugzilla.gnome.org/show_bug.cgi?id=756372
Error in the code pointing to the codepoint in the stack for the
current char value instead of the pointer in the input that the SAX
callback expects
Reported and fixed by Hugh Davenport
2015-11-20 17:16:06 +08:00
Daniel Veillard
e724879d96 Fix parsing short unclosed comment uninitialized access
For https://bugzilla.gnome.org/show_bug.cgi?id=746048
The HTML parser was too optimistic when processing comments and
didn't check for the end of the stream on the first 2 characters
2015-10-30 21:14:55 +08:00
Daniel Veillard
140c251e8e Recover unescaped less-than character in HTML recovery parsing
As pointed by Christian Schoenebeck <schoenebeck@crudebyte.com>
on the list and based on some of his early patches, this preserve
content when unescaped opening angle brackets are not escaped in
textual content like:
  <p>  a < b </p>
  <p> a <0 </p>
  <p> a <=0 </p>

while still reporting the error.
2015-06-30 11:36:28 +08:00
Daniel Veillard
292a9f293d Possible overflow in HTMLParser.c
For https://bugzilla.gnome.org/show_bug.cgi?id=720615

make sure that the encoding string passed is of reasonable size
2014-10-06 18:51:04 +08:00
Philip Withnall
579ebbcb3c HTMLparser: Correctly initialise a stack allocated structure
If not initialised, the ‘node’ member remains undefined.

Coverity issue: #60466

https://bugzilla.gnome.org/show_bug.cgi?id=731990
2014-07-26 20:09:42 +08:00
Gaurav
3e0eec4319 Adding some missing NULL checks
in SAX2 DOM building code and in the HTML parser
2014-06-13 14:45:20 +08:00
Daniel Veillard
b0c7e7e57f Fix an typo 'onrest' in htmlScriptAttributes
As pointed out by "Laurent <guitarneck@free.fr>"
2014-02-06 10:50:35 +01:00
Daniel Veillard
4e1476c5ea adding init calls to xml and html Read parsing entry points
As pointed out by "Tassyns, Bram <BramT@enfocus.com>" on the list
some call had it other didn't, clean it up and add to all missing
ones
2013-12-09 15:23:40 +08:00
Arnold Hendriks
826bc32020 Fix HTML push parser to accept HTML_PARSE_NODEFDTD
For https://bugzilla.gnome.org/show_bug.cgi?id=719515

fixes htmlParseTryOrFinish to interpret HTML_PARSE_NODEFDTD,
and updates xmllint to actually pass --nodefdtd to the push
version of the HTML parser
2013-11-29 14:12:12 +08:00
Daniel Veillard
bf058dce13 Fix the flushing out of raw buffers on encoding conversions
https://bugzilla.gnome.org/show_bug.cgi?id=692915

the new set of converting functions tried to limit the encoding
conversion of the raw buffer to the consumption one to work in
a more progressive fashion. Unfortunately this was bad for
performances and led to errors on progressive parsing when
a very large chunk was close to the end of the document. Fix
the new internal function and switch back to the old way of
converting. Fix another bug in the process.
2013-02-13 18:19:42 +08:00
Daniel Veillard
de0cc20c29 Fix some buffer conversion issues
https://bugzilla.gnome.org/show_bug.cgi?id=690202

Buffer overflow errors originating from xmlBufGetInputBase in 2.9.0
The pointers from the context input were not properly reset after
that call which can do reallocations.
2013-02-12 16:55:34 +08:00
Daniel Veillard
f8e3db0445 Big space and tab cleanup
Remove all space before tabs and space and tabs at end of lines.
2012-09-11 13:26:36 +08:00
Daniel Veillard
f933c89813 Keep non-significant blanks node in HTML parser
For https://bugzilla.gnome.org/show_bug.cgi?id=681822

Regardless if the option HTML_PARSE_NOBLANKS is set or not, blank nodes
are removed from a HTML document, for example:

<html>
  <head>
    <title>This is a test.</title>
  </head>
  <body>
    <p>This is a test.</p>
  </body>
</html>

is read as:

<html><head><title>This is a test.</title></head><body>
    <p>This is a test.</p>
  </body></html>

This changes the default behaviour but the old behaviour is available
as expected when using the parser flag HTML_PARSE_NOBLANKS

Based on original patch from Igor Ignatyuk <igor_ignatiouk@hotmail.com>

* HTMLparser.c: change various places in the parser where ignorable_space
  SAX callback was called without checking for the parser flag preference
* xmllint.c: make sure we use the new flag even for HTML parsing
* result/HTML/*: this modifies the output of a number of tests
2012-09-07 19:32:12 +08:00
Conrad Irwin
b60061a7a5 Visible HTML elements close the head tag
In HTML email it's common to find arbitrary fragments of HTML, the one
that triggered this change was of the form:

    <meta><font></font><div>...

Before this change the <font> tag was part of the implicit <head> that
gets created for the <meta> tag, after this change, it is part of the
 <body>, which more closely matches the behaviour of modern HTML
implementations.
2012-08-17 19:14:29 +08:00
Daniel Veillard
00ac0d3b96 More cleanups for input/buffers code
When calling xmlParserInputBufferPush, the buffer may be reallocated
and at the input level the pointers for base, cur and end need to
be reevaluated.
* buf.c buf.h: add two new functions, one to get the base from the
  input of the buffer, and another one to reset the pointers based
  on the cur and base inded
* HTMLparser.c parser.c: cleanup to use the new helper functions
  as well as making sure size_t is used for the indexes computations
2012-07-23 14:24:27 +08:00
Daniel Veillard
61551a1eb7 Cleanup function xmlBufResetInput() to set input from Buffer
This was scattered in a number of modules, xmlParserInputPtr
have usually their base, cur and end pointer set from an
xmlBuf used as input.
* buf.c buf.h: add a new function implementing this setup
* parser.c HTMLparser.c catalog.c parserInternals.c xmlreader.c
  use the new function instead of digging into the buffer in
  all those modules
2012-07-23 14:24:27 +08:00
Daniel Veillard
a78d803639 Convert of the HTML parser to new input buffers
Changes similar to the ones done in the XML parser for the
routines which are not shared.
2012-07-23 14:24:27 +08:00
Denis Pauk
a0cd075d94 HTML parser error with <noscript> in the <head>
For https://bugzilla.gnome.org/show_bug.cgi?id=615785
When the <noscript> is found, <head> is closed and a <body> element is created.
The real <body id="xxx"> gets skipped over, so I can't see any of the
body's attributes.
Just don't close <head> when encountering a <noscript>
Add a regression test too
2012-05-11 19:31:12 +08:00
Denis Pauk
fdf990c2ef Allow to parse 1 byte HTML files
For https://bugzilla.gnome.org/show_bug.cgi?id=605740

File 1 byte long were not accepted by the HTML push parser
2012-05-10 20:40:49 +08:00
Martin Schröder
b91111b475 Patch that fixes the skipping of the HTML_PARSE_NOIMPLIED flag
For https://bugzilla.gnome.org/show_bug.cgi?id=642916

I just noticed that the HTML_PARSE_NOIMPLIED flag that you can pass to the
HTML-Parser methods doesn't do anything. Its intended purpose is to stop the
HTML-parser from forcibly adding a pair of html/body tags if the stream does
not contain any.

This is highly useful when you don't need this level of strictness.
Unfortunately, specifying it doesn't work, because the option is not
copied into the parsing context.
2012-05-10 18:52:37 +08:00
Lin Yi-Li
24464be639 Avoid memory leak if xmlParserInputBufferCreateIO fails
For https://bugzilla.gnome.org/show_bug.cgi?id=643949

In case of error on an IO creation input the given context
is terminated with the given close function, except if the
error happened in xmlParserInputBufferCreateIO. This can
lead to a resource leak which is fixed by this patch.
2012-05-10 16:14:55 +08:00
Denis Pauk
868d92da89 Add HTML parser support for HTML5 meta charset encoding declaration
For https://bugzilla.gnome.org/show_bug.cgi?id=655218

http://www.w3.org/TR/2011/WD-html5-20110525/semantics.html#the-meta-element

"""
The charset attribute specifies the character encoding used by the document.
This is a character encoding declaration. If the attribute is present in an XML
document, its value must be an ASCII case-insensitive match for the string
"UTF-8" (and the document is therefore forced to use UTF-8 as its
encoding).
"""

However, while <meta http-equiv="Content-Type" content="text/html;
charset=utf8"> works, <meta charset="utf8"> does not.

While libxml2 HTML parser is not tuned for HTML5, this is a simple
addition

Also added a testcase
2012-05-10 15:34:57 +08:00
Pavel Andrejs
8ad4da5f56 HTML element position is not detected propperly
The data in node_seq in xmlParserCtxt was not updated properly
when parsing HTML. This patch fixes the accounting for both
pull and push mode of HTML parsing.
2012-05-08 11:01:12 +08:00
Daniel Veillard
c62efc847c Add options to ignore the internal encoding
For both XML and HTML, the document can provide an encoding
either in XMLDecl in XML, or as a meta element in HTML head.
This adds options to ignore those encodings if the encoding
is known in advace for example if the content had been converted
before being passed to the parser.

* parser.c include/libxml/parser.h: add XML_PARSE_IGNORE_ENC option
  for XML parsing
* include/libxml/HTMLparser.h HTMLparser.c: adds the
  HTML_PARSE_IGNORE_ENC for HTML parsing
* HTMLtree.c: fix the handling of saving when an unknown encoding is
  defined in meta document header
* xmllint.c: add a --noenc option to activate the new parser options
2011-05-26 11:47:37 +08:00
Denis Pauk
91d239c5cf 617468 fix progressive HTML parsing with style using "'"
Style and script can contain ',"". This patch fixes call
htmlParseLookupSequence with set flag 'ignoreattrval' to
ignore this char
2010-11-04 12:39:18 +01:00
Pierre Belzile
d4b5447141 614005 Possible erroneous HTML parsing on unterminated script
Fix a nasty error handling problem when an error happen at the
end of the input buffer.
2010-11-04 10:18:17 +01:00
Daniel Veillard
8ad2930f62 make sure htmlCtxtReset do reset the disableSAX field
As pointed out by Stefan Behnel <stefan_ml@behnel.de>
2010-10-28 11:51:22 +02:00
Michael Day
af58ee130f Fix a couple of typo in HTML parser error messages 2010-08-02 13:43:28 +02:00
Daniel Veillard
f1121c48af Add an HTML parser option to avoid a default doctype
- include/libxml/HTMLparser.h: defines the new HTML parser option
  HTML_PARSE_NODEFDTD
- HTMLparser.c: if option is set don't add a default DTD
- xmllint.c: add the corresponding --nodefdtd option in xmllint
2010-07-26 14:02:42 +02:00
Daniel Veillard
06c93b7509 Remove a few warnings 2010-03-15 16:08:44 +01:00
Daniel Veillard
3c080d6d72 Don't give default HTML boolean attribute values in parser
* HTMLparser.c: don't default value of HTML boolean attributes in the
  parser
* SAX2.c: move this to SAX2 tree building backend
* result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax
  result/HTML/wired.html.sax: this changes a few HTML SAX regression
  tests
2010-03-15 15:47:50 +01:00
Eugene Pimenov
615904f582 Switch the HTML parser to be non-recursive
* HTMLparser.c: new htmlParseElementInternal non recursive, with
  htmlParseContentInternal and new function to handle node info
  and element end.
* include/libxml/parser.h: add new stack for element info in parser
  context
* parserInternals.c: fee element info stack
2010-03-15 15:16:02 +01:00
Eugene Pimenov
ef9c636ac1 Cleanup a couple of weirdness in HTML parser 2010-03-15 11:37:48 +01:00
Eugene Pimenov
1e60fbcb6f htmlCheckEncoding doesn't update input-end after shrink
* HTMLparser.c: add the missing update to the end pointer
2010-03-10 18:10:49 +01:00
Daniel Veillard
e20fb5a72c Fix xmlParseInNodeContext for HTML content
xmlParseInNodeContext notices that the enclosing document is
an HTML document, so invoke the HTML parser for that fragment, and
the HTML parser finding a "<p>hello world!</p>" document automatically
augment it with defaulted <html> and <body>. This defaulting should
be turned off in the HTML parser for this to work, but there is no
such HTML parser option. There is an htmlOmittedDefaultValue global
variable that you could use, but really we should not rely on global
variable for processing options anymore, best is to add an
HTML_PARSE_NOIMPLIED.
* include/libxml/HTMLparser.h: add the HTML_PARSE_NOIMPLIED parser flag
* HTMLparser.c: do add implied element if HTML_PARSE_NOIMPLIED is set
* parser.c: add HTML_PARSE_NOIMPLIED to options for xmlParseInNodeContext
  on HTML documents
2010-01-29 20:47:08 +01:00
Eugene Pimenov
4b41f15dcd Fix some missing commas in HTML element lists
* HTMLparse.c: fix the macros BLOCK and INLINE to use commas and
  avoid transparent contatenation of strings
2010-01-20 14:25:59 +01:00
Daniel Veillard
13cee4e37b Fix a bunch of scan 'dead increments' and cleanup
* HTMLparser.c c14n.c debugXML.c entities.c nanohttp.c parser.c
  testC14N.c uri.c xmlcatalog.c xmllint.c xmlregexp.c xpath.c:
  fix unused variables, or unneeded increments as well as a couple
  of space issues
* runtest.c: check for NULL before calling unlink()
2009-09-05 14:52:55 +02:00
Daniel Veillard
eeb9932990 444994 HTML chunked failure for attribute with <>
* HTMLparser.c: fix htmlParseLookupSequence to not save ctxt->checkIndex
  when the current buffer ends within an attribute value, as this
  information would be missed in next pass.
2009-08-25 14:42:16 +02:00
Adiel Mittmann
8a103793f2 Non ASCII character may be split at buffer end
* HTMLparser.c: make sure when we call xmlParserInputGrow in
  htmlCurrentChar, to reset the current pointer
2009-08-25 11:27:13 +02:00
Markus Kull
56a03035bf 572129 speed up parasing of large HTML text nodes
* HTMLparser.c: use a different lookup function htmlParseLookupChars()
  to avoid the quadratic behaviour
2009-08-24 19:00:23 +02:00
Daniel Veillard
b468f7444c Remove a pedantic warning 2009-08-24 18:45:33 +02:00
Daniel Veillard
856c668c1a Fix HTML parsing with 0 character in CDATA
* HTMLparser.c: 0 before the end of the input need some special case
  handling, raise the error and return a space instead
2009-08-24 18:16:56 +02:00
Daniel Veillard
029a04d265 541335 HTML avoid creating 2 head or 2 body element
* HTMLparser.c: check when we see an head or a body tag and avoid
  autogenerating them
* include/libxml/parser.h: the values for ctxt->html change depending
  on the head or body tags being seen
2009-08-24 12:50:23 +02:00
Daniel Veillard
6339c1a886 541237 error correcting missing end tags in HTML
* HTMLparser.c: make sure /p closes the FONTSTYLE list of elements
2009-08-24 11:59:51 +02:00
Daniel Veillard
db4ac221f0 Fix a small problem on previous HTML parser patch 2009-08-22 17:58:31 +02:00
Daniel Veillard
e77db16ab1 592430 - HTML parser runs into endless loop
* HTMLparser.c: fix the problem with detection erroring absolutely, and
  properly popping up the stack when in EOF, also passes XML_PARSE_HUGE
  when decoding options.
2009-08-22 11:32:38 +02:00
Daniel Veillard
7459c595a0 588441 allow '.' in HTML Names even if invalid
* HTMLparser.c: just allow '.' in htmlParseHTMLName list of characters
2009-08-13 10:10:29 +02:00
Daniel Veillard
533ec0e073 579317 Try to find the HTML encoding information
* HTMLparser.c: if we hit an encoding error before parsing a potential
  <meta> with the info look in the input buffer to see if we can find
  it instead of forcing a blind switch to ISO-8859-1
2009-08-12 23:00:22 +02:00
Jiri Netolicky
446e126de5 576368 – htmlChunkParser with special attributes
* HTMLparser.c: htmlChunkParsing failed when the chunk ends inside
  element after some attribute which  has a '>' char in its value.
2009-08-07 17:05:36 +02:00
Daniel Veillard
4d3e2da7f8 * HTMLparser.c: make sure we keep line numbers fixes #580705
based Aaron Patterson patch
Daniel
2009-05-15 17:55:45 +02:00
Roland Steiner
04f8eef852 * HTMLparser.c: a broken HTML table attributes initialization,
fixes #581803, by Roland Steiner <rolandsteiner@google.com>
Daniel
2009-05-12 09:16:16 +02:00
Daniel Veillard
7f4547cdbd preparing the release of 2.7.2 fix the Solaris portability issue
* configure.in doc/* NEWS: preparing the release of 2.7.2
* dict.c: fix the Solaris portability issue
* parser.c: additional cleanup on #554660 fix
* test/ent13 result/ent13* result/noent/ent13*: added the
  example in the regression test suite.
* HTMLparser.c: handle leading BOM in htmlParseElement()
Daniel

svn path=/trunk/; revision=3799
2008-10-03 07:58:23 +00:00
Daniel Veillard
a57ba4ce96 fix an HTML parsing error on large data sections reported by Mike Day add
* HTMLparser.c: fix an HTML parsing error on large data sections
  reported by Mike Day
* test/HTML/utf8bug.html result/HTML/utf8bug.html.err
  result/HTML/utf8bug.html.sax result/HTML/utf8bug.html: add the
  reproducer to the test suite
daniel

svn path=/trunk/; revision=3797
2008-09-25 16:06:18 +00:00
Daniel Veillard
4cc67bb77e patch from Robert Schwebel , allows to compile the example if configured
* doc/examples/reader3.c: patch from  Robert Schwebel , allows to
  compile the example if configured without output support fixes
  #545582
* Makefile.am: add testrecurse to the make check tests
* HTMLparser.c: if the parser got a encoding argument it should be
  used over what the meta specifies, patch fixing #536346
Daniel

svn path=/trunk/; revision=3785
2008-08-29 19:58:23 +00:00
Daniel Veillard
ae0765b681 more progresses against the official regression tests small cleanup for
* runxmlconf.c: more progresses against the official regression tests
* runsuite.c: small cleanup for non-leak reports
* include/libxml/tree.h: parsing flags and other properties are
  now added to the document node, this is generally useful and
  allow to make Name and NmToken validations based on the parser
  flags, more specifically the 5th edition of XML or not
* HTMLparser.c tree.c: small side effects for the previous changes
* parser.c SAX2.c valid.c: the bulk of teh changes are here,
  the parser and validation behaviour can be affected, parsing
  flags need to be copied, lot of changes. Also fixing various
  validation problems in the regression tests.
Daniel

svn path=/trunk/; revision=3762
2008-07-31 19:54:59 +00:00
Daniel Veillard
ed86dc2383 applied patch from Ashwin fixing a number of realloc problems improve
* uri.c: applied patch from Ashwin fixing a number of realloc problems
* HTMLparser.c: improve handling for misplaced html/head/body
Daniel

svn path=/trunk/; revision=3740
2008-04-24 11:58:41 +00:00
Daniel Veillard
36de63e71d apparently it's okay to forget the semicolumn after entity refs in HTML,
* HTMLparser.c: apparently it's okay to forget the semicolumn after
  entity refs in HTML, fixing char refs parsing accordingly based on
  T. Manske patch, this should fix #517653
Daniel

svn path=/trunk/; revision=3726
2008-04-03 09:05:05 +00:00
Daniel Veillard
35fcbb84d2 patch from Arnold Hendriks improving parsing of html within html bogus
* HTMLparser.c: patch from Arnold Hendriks improving parsing of
  html within html bogus data, still not a complete fix though
Daniel

svn path=/trunk/; revision=3704
2008-03-12 21:43:39 +00:00
Daniel Veillard
c5b43cc03a avoid stopping parsing when encountering out of range characters in an
* HTMLparser.c: avoid stopping parsing when encountering
  out of range characters in an HTML file, report and 
  continue processing instead, should fix #472696
Daniel

svn path=/trunk/; revision=3675
2008-01-11 07:41:39 +00:00
Daniel Veillard
640f89ef61 fix definition for <embed> to avoid error when saving back, patch from
* HTMLparser.c: fix definition for <embed> to avoid error
  when saving back, patch from Stefan Behnel fixing 495213
Daniel

svn path=/trunk/; revision=3671
2008-01-11 06:24:09 +00:00
Daniel Veillard
861101d1fa fixed bug #381877, avoid reading over the end of stream when generating an
* HTMLparser.c: fixed bug #381877, avoid reading over the end
  of stream when generating an UTF-8 encoding error.
Daniel

svn path=/trunk/; revision=3627
2007-06-12 08:38:57 +00:00
Daniel Veillard
491e58e575 applied patch from Michael Day to add support for <embed> Daniel
* HTMLparser.c: applied patch from Michael Day to add support for <embed>
Daniel

svn path=/trunk/; revision=3611
2007-05-02 16:15:18 +00:00
Daniel Veillard
739e9d0981 Dohh !
Daniel

svn path=/trunk/; revision=3610
2007-04-27 09:33:58 +00:00
Daniel Veillard
4d1320fa5b Jean-Daniel Dupas pointed a couple of problems in htmlCreateDocParserCtxt.
* HTMLparser.c: Jean-Daniel Dupas pointed a couple of problems
  in htmlCreateDocParserCtxt.
Daniel

svn path=/trunk/; revision=3609
2007-04-26 08:55:33 +00:00
Daniel Veillard
42720248e6 change the way script/style are parsed to not try to detect comments,
* HTMLparser.c: change the way script/style are parsed to
  not try to detect comments, reported by Mike Day
* result/HTML/doc3.*: affects the result of that test
Daniel

svn path=/trunk/; revision=3598
2007-04-16 07:02:31 +00:00
William M. Brack
e978ae25ca fixed memory access error on parsing of meta data which had errors (bug
* HTMLparser.c: fixed memory access error on parsing of meta data
  which had errors (bug #382206).  Also cleaned up a few warnings
  by adding some additional DECL macros.

svn path=/trunk/; revision=3593
2007-03-21 06:16:02 +00:00
Daniel Veillard
1032ac4c5c applied patch from Steven Rainwater to fix UTF8ToHtml behaviour on code
* HTMLparser.c: applied patch from Steven Rainwater to fix
  UTF8ToHtml behaviour on code points which are not mappable to
  predefined HTML entities, fixes #377544
Daniel
2006-11-23 16:18:30 +00:00
Daniel Veillard
772869fe10 change htmlCtxtReset() following Michael Day bug report and suggestion.
* HTMLparser.c: change htmlCtxtReset() following Michael Day bug
  report and suggestion.
Daniel
2006-11-08 09:16:56 +00:00
Daniel Veillard
890fd9f9f3 applied a reworked version of Usamah Malik patch to avoid growing the
* HTMLparser.c: applied a reworked version of Usamah Malik patch
  to avoid growing the parser stack in some autoclose cases, should
  fix #361221
Daniel
2006-10-27 12:53:28 +00:00
Daniel Veillard
af616a7386 fix one problem found in htmlCtxtUseOptions() and pointed in #340591
* HTMLparser.c: fix one problem found in htmlCtxtUseOptions()
  and pointed in #340591
Daniel
2006-10-17 20:18:39 +00:00
Daniel Veillard
8a82ae12c3 fixed teh 2 stupid bugs affecting htmlReadDoc() and htmlReadIO() this
* HTMLparser.c: fixed teh 2 stupid bugs affecting htmlReadDoc() and
  htmlReadIO() this should fix #340322
Daniel
2006-10-17 20:04:10 +00:00
Daniel Veillard
c47d263049 fixing HTML minimized attribute values to be generated internally if not
* HTMLparser.c: fixing HTML minimized attribute values to be generated
  internally if not present, fixes bug #332124
* result/HTML/doc2.htm.sax result/HTML/doc3.htm.sax
  result/HTML/wired.html.sax: this affects the SAX event strem for
  a few test cases
Daniel
2006-10-17 16:13:27 +00:00
Daniel Veillard
48519092e5 fixing HTML entities in attributes parsing bug #362552 added to the
* HTMLparser.c: fixing HTML entities in attributes parsing bug #362552
* result/HTML/entities2.html* test/HTML/entities2.html: added to
  the regression suite
Daniel
2006-10-17 15:56:35 +00:00
Daniel Veillard
7e30356556 fix #348252 if the document clains to be in a different encoding in the
* HTMLparser.c: fix #348252 if the document clains to be in a
  different encoding in the meta tag and it's obviously wrong,
  don't screw up the end of the content.
Daniel
2006-10-16 13:14:55 +00:00
Daniel Veillard
68716a772c fix a chunking and script bug #347708 Daniel
* HTMLparser.c: fix a chunking and script bug #347708
Daniel
2006-10-16 09:32:17 +00:00
Daniel Veillard
28aac0b0f4 remove a warning check with uppercase for AIX iconv() should fix #352644
* HTMLparser.c: remove a warning
* encoding.c: check with uppercase for AIX iconv() should fix #352644
* doc/examples/Makefile.am: partially handle one bug report
Daniel
2006-10-16 08:31:18 +00:00
Daniel Veillard
f1a27c659e added --html --memory to test htmlReadMemory to test #321632 added various
* xmllint.c: added --html --memory to test htmlReadMemory to
  test #321632
* HTMLparser.c: added various initialization calls which may help
  #321632 but not conclusive
* testapi.c tree.c include/libxml/tree.h: fixed compilation with
  --with-minimum --with-sax1 and --with-minimum --with-schemas
  fixing #326442
Daniel
2006-10-13 22:33:03 +00:00
Daniel Veillard
34c647cfae exports htmlNewParserCtxt() as Michael Day pointed out this is needed to
* HTMLparser.c include/libxml/HTMLparser.h: exports htmlNewParserCtxt()
  as Michael Day pointed out this is needed to use htmlCtxtRead*()
Daniel
2006-09-21 06:53:59 +00:00
Daniel Veillard
065abe8565 applied const'ification of strings patch from Matthias Clasen Daniel
* HTMLparser.c: applied const'ification of strings patch from
  Matthias Clasen
Daniel
2006-07-03 08:55:04 +00:00
Daniel Veillard
30e7607b7a a bunch of small cleanups based on coverity reports. Daniel
* HTMLparser.c parser.c parserInternals.c pattern.c uri.c: a bunch
  of small cleanups based on coverity reports.
Daniel
2006-03-09 14:13:55 +00:00
Daniel Veillard
499cc9204f try to fix xmlParseInNodeContext when operating on an HTML document.
* HTMLparser.c libxml.h parser.c: try to fix xmlParseInNodeContext
  when operating on an HTML document.
Daniel
2006-01-18 17:22:35 +00:00
Daniel Veillard
6a0baa0cd8 fixed a number of warnings shown by HP-UX compiler and reported by Rick
* HTMLparser.c configure.in parserInternals.c runsuite.c runtest.c
  testapi.c xmlschemas.c xmlschemastypes.c xmlstring.c: fixed a number
  of warnings shown by HP-UX compiler and reported by Rick Jones
Daniel
2005-12-10 11:11:12 +00:00
Daniel Veillard
b990008f05 script HTML parser error fix, corrects bug #319715 added test from Michael
* HTMLparser.c: script HTML parser error fix, corrects bug #319715
* result/HTML/53867* test/HTML/53867.html: added test from Michael Day
  to the regression suite
Daniel
2005-10-25 12:36:29 +00:00
Daniel Veillard
2cf36a1cc1 typo fix from Michael Day Daniel
* HTMLparser.c: typo fix from Michael Day
Daniel
2005-10-25 12:21:29 +00:00
Daniel Veillard
36d73403ff Applied the last patch from Gary Coady for #304637 changing the behaviour
* HTMLparser.c: Applied the last patch from Gary Coady for #304637
  changing the behaviour when text nodes are found in body
* result/HTML/*: this changes the output of some tests
Daniel
2005-09-01 09:52:30 +00:00
Daniel Veillard
8874b94cd2 added a parser XML_PARSE_COMPACT option to allocate small text nodes (less
* HTMLparser.c parser.c SAX2.c debugXML.c tree.c valid.c xmlreader.c
  xmllint.c include/libxml/HTMLparser.h include/libxml/parser.h:
  added a parser XML_PARSE_COMPACT option to allocate small
  text nodes (less than 8 bytes on 32bits, less than 16bytes on 64bits)
  directly within the node, various changes to cope with this.
* result/XPath/tests/* result/XPath/xptr/* result/xmlid/*: this
  slightly change the output
Daniel
2005-08-25 13:19:21 +00:00
Daniel Veillard
ea4b0baef2 added a recovery mode for the HTML parser based on the suggestions of bug
* HTMLparser.c include/libxml/HTMLparser.h: added a recovery mode
  for the HTML parser based on the suggestions of bug #169834 by
  Paul Loberg
Daniel
2005-08-23 16:06:08 +00:00
Daniel Veillard
d2755a8134 fixed an uninitialized memory access spotted by valgrind Daniel
* HTMLparser.c: fixed an uninitialized memory access spotted by
  valgrind
Daniel
2005-08-07 23:42:39 +00:00
Daniel Veillard
24505b0f5c a lot of small cleanups based on Linus' sparse check output. Daniel
* HTMLparser.c SAX2.c encoding.c globals.c parser.c relaxng.c
  runsuite.c runtest.c schematron.c testHTML.c testReader.c
  testRegexp.c testSAX.c testThreads.c valid.c xinclude.c xmlIO.c
  xmllint.c xmlmodule.c xmlschemas.c xpath.c xpointer.c: a lot of
  small cleanups based on Linus' sparse check output.
Daniel
2005-07-28 23:49:35 +00:00
Daniel Veillard
7d2b323ed6 fixed a potential buffer overrun error introduced on last commit to
* HTMLparser.c: fixed a potential buffer overrun error introduced
  on last commit to htmlParseScript() c.f. #310229
Daniel
2005-07-14 08:57:39 +00:00
Daniel Veillard
358fef4b1e applied UTF-8 script parsing bug #310229 fix from Jiri Netolicky added the
* HTMLparser.c: applied UTF-8 script parsing bug #310229 fix from
  Jiri Netolicky
* result/HTML/script2.html* test/HTML/script2.html: added the test
  case from the regression suite
Daniel
2005-07-13 16:37:38 +00:00
Daniel Veillard
597f1c1f34 applied patch from James Bursa fixing an html parsing bug in push mode
* HTMLparser.c: applied patch from James Bursa fixing an html parsing
  bug in push mode
* result/HTML/repeat.html* test/HTML/repeat.html: added the test to the
  regression suite
Daniel
2005-07-03 23:00:18 +00:00
Daniel Veillard
5d4644ef6e revamped the elfgcchack.h format to cope with gcc4 change of aliasing
* doc/apibuild.py doc/elfgcchack.xsl: revamped the elfgcchack.h
  format to cope with gcc4 change of aliasing allowed scopes, had
  to add extra informations to doc/libxml2-api.xml to separate
  the header from the c module source.
* *.c: updated all c library files to add a #define bottom_xxx
  and reimport elfgcchack.h thereafter, and a bit of cleanups.
* doc//* testapi.c: regenerated when rebuilding the API
Daniel
2005-04-01 13:11:58 +00:00
William M. Brack
21e4ef20f6 Re-examined the problems of configuring a "minimal" library.
Synchronized the header files with the library code in order
to assure that all the various conditionals (LIBXML_xxxx_ENABLED)
were the same in both.  Modified the API database content to more
accurately reflect the conditionals.  Enhanced the generation
of that database.  Although there was no substantial change to
any of the library code's logic, a large number of files were
modified to achieve the above, and the configuration script
was enhanced to do some automatic enabling of features (e.g.
--with-xinclude forces --with-xpath).  Additionally, all the format
errors discovered by apibuild.py were corrected.
* configure.in: enhanced cross-checking of options
* doc/apibuild.py, doc/elfgcchack.xsl, doc/libxml2-refs.xml,
  doc/libxml2-api.xml, gentest.py: changed the usage of the
  <cond> element in module descriptions
* elfgcchack.h, testapi.c: regenerated with proper conditionals
* HTMLparser.c, SAX.c, globals.c, tree.c, xmlschemas.c, xpath.c,
  testSAX.c: cleaned up conditionals
* include/libxml/[SAX.h, SAX2.h, debugXML.h, encoding.h, entities.h,
  hash.h, parser.h, parserInternals.h, schemasInternals.h, tree.h,
  valid.h, xlink.h, xmlIO.h, xmlautomata.h, xmlreader.h, xpath.h]:
  synchronized the conditionals with the corresponding module code
* doc/examples/tree2.c, doc/examples/xpath1.c, doc/examples/xpath2.c:
  added additional conditions required for compilation
* doc/*.html, doc/html/*.html: rebuilt the docs
2005-01-02 09:53:13 +00:00
Daniel Veillard
29614c7040 make sure xmlCtxtReadFile and htmlCtxtReadFile go through the catalog
* HTMLparser.c parser.c: make sure xmlCtxtReadFile and htmlCtxtReadFile
  go through the catalog resolution.
* gentest.py testapi.c: fix a side effect wrning of the change
Daniel
2004-11-26 10:47:26 +00:00
Daniel Veillard
a521d28751 better handling of conditional features more testing on parser contexts
* gentest.py testapi.c: better handling of conditional features
* HTMLparser.c SAX2.c parserInternals.c xmlwriter.c: more testing
  on parser contexts closed leaks, error messages
Daniel
2004-11-09 14:59:59 +00:00
Daniel Veillard
4259532303 more types, more coverage more problems fixed Daniel
* gentest.py testapi.c: more types, more coverage
* parser.c parserInternals.c relaxng.c valid.c xmlIO.c
  xmlschemastypes.c: more problems fixed
Daniel
2004-11-08 10:52:06 +00:00
Daniel Veillard
ce682bc24b autogenerate a minimal NULL value sequence for unknown pointer types This
* gentest.py testapi.c: autogenerate a minimal NULL value sequence
  for unknown pointer types
* HTMLparser.c SAX2.c chvalid.c encoding.c entities.c parser.c
  parserInternals.c relaxng.c valid.c xmlIO.c xmlreader.c
  xmlsave.c xmlschemas.c xmlschemastypes.c xmlstring.c xpath.c
  xpointer.c: This uncovered an impressive amount of entry points
  not checking for NULL pointers when they ought to, closing all
  the open gaps.
Daniel
2004-11-05 17:22:25 +00:00