summaryrefslogtreecommitdiff
path: root/xmlIO.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Change calls to xmlCharEncInput to set flush false"Nick Wellnhofer2018-03-171-2/+2
| | | | | | | This reverts commit 6e6ae5daa6cd9640c9a83c1070896273e9b30d14 which broke decoding of larger documents with ICU. See https://bugs.chromium.org/p/chromium/issues/detail?id=820163
* Change calls to xmlCharEncInput to set flush false when not final call. ↵Joel Hockey2018-01-081-2/+2
| | | | Having flush incorrectly set to true causes errors for ICU.
* Fix libz and liblzma detectionNick Wellnhofer2017-11-271-21/+21
| | | | | | | | | 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.
* Fix IO callback signaturesNick Wellnhofer2017-11-091-4/+2
|
* Refactor name and type signature for xmlNopVlad Tsyrklevich2017-11-091-4/+6
| | | | | | | Update xmlNop's name to xmlInputReadCallbackNop and its type signature to match xmlInputReadCallback. Fixes bug 786134.
* Simplify Windows IO functionsNick Wellnhofer2017-10-091-129/+21
| | | | | | | Remove "native" non-Unicode functions which were only needed for pre-NT systems like Windows 95/98. Don't redefine `stat` but use `struct _stat` and `_stat()` instead.
* Fix the Windows header messNick Wellnhofer2017-10-091-2/+3
| | | | | | | | | | | | Don't include windows.h and wsockcompat.h from config.h but only when needed. Don't define _WINSOCKAPI_ manually. This was apparently done to stop windows.h from including winsock.h which is a problem if winsock2.h wasn't included first. But on MinGW, this causes compiler warnings. Define WIN32_LEAN_AND_MEAN instead which has the same effect. Always use the compiler-defined _WIN32 macro instead of WIN32.
* Fix pointer/int cast warnings on 64-bit WindowsNick Wellnhofer2017-10-091-5/+6
| | | | | | | | | | | On 64-bit Windows, `long` is 32 bits wide and can't hold a pointer. Switch to ptrdiff_t instead which should be the same size as a pointer on every somewhat sane platform without requiring C99 types like intptr_t. Fixes bug 788312. Thanks to J. Peter Mugaas for the report and initial patch.
* Porting libxml2 on zOS encoding of codeStéphane Michaut2017-08-281-2/+7
| | | | | | | | | | First set of patches for zOS - entities.c parser.c tree.c xmlschemas.c xmlschemastypes.c xpath.c xpointer.c: ask conversion of code to ISO Latin 1 to avoid having the compiler assume EBCDIC codepoint for characters. - xmlmodule.c: make sure we have support for modules - xmlIO.c: zOS path names are special avoid dsome of the expectstions from Unix/Windows
* Documentation fixesNick Wellnhofer2017-06-181-1/+1
| | | | Fixes bug 347465, bug 599433, bug 624550, bug 698253.
* Fix unused-parameter warningsNick Wellnhofer2017-06-171-1/+1
|
* Allow zero sized memory input buffersNick Wellnhofer2017-06-101-2/+2
| | | | Useful for a fuzz target I'm working on.
* Revert "Add an XML_PARSE_NOXXE flag to block all entities loading even local"Nick Wellnhofer2017-06-061-35/+5
| | | | | | | This reverts commit 2304078555896cf1638c628f50326aeef6f0e0d0. The new flag doesn't work and the change even broke the XML_PARSE_NONET option.
* Add an XML_PARSE_NOXXE flag to block all entities loading even localDoran Moppert2017-04-071-5/+35
| | | | | | | | | For https://bugzilla.gnome.org/show_bug.cgi?id=772726 * include/libxml/parser.h: Add a new parser flag XML_PARSE_NOXXE * elfgcchack.h, xmlIO.h, xmlIO.c: associated loading routine * include/libxml/xmlerror.h: new error raised * xmllint.c: adds --noxxe flag to activate the option
* Fix format string warningsNick Wellnhofer2016-10-121-1/+1
| | | | | | Also fixes bug #768199: https://bugzilla.gnome.org/show_bug.cgi?id=768199
* Fix some format string warnings with possible format string vulnerabilityDavid Kilzer2016-05-231-7/+7
| | | | | | | | 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.
* Reenable xz support by defaultDaniel Veillard2015-11-031-6/+6
| | | | | | | For https://bugzilla.gnome.org/show_bug.cgi?id=757466 problem was introduced by commit f3f86ff465c92c79f834d7b981f3c7274a8bb5c8 for https://bugzilla.gnome.org/show_bug.cgi?id=711026
* Fix a couple of issues raised by make distDaniel Veillard2014-10-131-0/+7
|
* xmlIO: Handle error returns from dup()Philip Withnall2014-10-061-2/+2
| | | | | | | | If dup() fails and returns -1, gzdopen() will transparently return NULL, but then close() will fail after being called on an invalid FD. Change the code to only call close() on valid FDs. Coverity issue: #72382
* Remove a couple of dead conditionsGaurav Gupta2014-07-261-5/+2
| | | | For https://bugzilla.gnome.org/show_bug.cgi?id=733711
* xmlIO: Fix an FD leak on gzdopen() failurePhilip Withnall2014-07-261-2/+12
| | | | | | | | | | According to the documentation, gzdopen() does not close the FD on failure (but does effectively close it on success, since gzclose() closes it). Coverity issues: #60440, #60441 https://bugzilla.gnome.org/show_bug.cgi?id=731990
* Portability fixPatrick Monnerat2013-12-121-3/+3
| | | | Don't assume fileno for stdin and stdout are 0 and 1
* Fix a regression in xmlGetDocCompressMode()Daniel Veillard2013-05-101-0/+17
| | | | | | | | | | | | The switch to xzlib had for consequence that the compression level of the input was not gathered anymore in ctxt->input->buf, then the parser compression flags was left to -1 and propagated to the resulting document. Fix the I/O layer to get compression detection in xzlib, then carry it in the input buffer and the resulting document This should fix https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3456
* Fix an output buffer flushing conversion bugMikhail Titov2013-03-271-7/+9
| | | | | for https://bugzilla.gnome.org/show_bug.cgi?id=694982 On a flush operation, everything must be converted
* Fix the flushing out of raw buffers on encoding conversionsDaniel Veillard2013-02-131-2/+2
| | | | | | | | | | | | 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.
* Fix large parse of file from memoryDaniel Veillard2012-10-261-1/+1
| | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=862969 The new code trying to detect excessive input lookup would just get wrong sometimes in the case of very large file parsed directly from memory.
* Big space and tab cleanupDaniel Veillard2012-09-111-2/+2
| | | | Remove all space before tabs and space and tabs at end of lines.
* Support long path names on WNTMichael Stahl2012-09-071-3/+11
| | | | | | | | | | | | | so we've got this patch to libxml2 2.7.6 in the LibreOffice code base, inherited from OOo. it fixes a definite problem, which is that Windows has a rather low maximum path length restriction, and there is a special trick on NT whereby path names can be prefixed with "\\?\", in which case the maximum length is 32k, which ought to be sufficient even for bloated office suites :) I'll attach the patch to the xmlCanonicPath function. note that i didn't write this and am by no means an expert on either Microsoftean platforms or libxml so maybe it's not the best way to do it.
* use xmlBuf... if DEBUG_INPUT is definedRoumen Petrov2012-08-071-1/+1
|
* Provide new accessors for xmlOutputBufferDaniel Veillard2012-08-061-0/+33
| | | | | | | | | To avoid digging into buf->buffer insternal strcuture the two new entry points xmlOutputBufferGetContent() and xmlOutputBufferGetSize() should make the ode cleaner. * include/libxml/xmlIO.h: add two new functions * xmlIO.c: impement the 2 functions based on the new buffer entry points
* Convert xmlIO.c to the new input and output buffersDaniel Veillard2012-07-231-90/+82
| | | | | Relatively mechanical changes, this also led to a couple of fixes upon review of the I/O code on buffer usage.
* Cleanups of lzma supportDaniel Veillard2012-01-271-5/+5
| | | | | | | | - fix inclusion of the separated file - use namespaced name for the 4 non-static routines - add padding after external structures included in-situ - add new requirement to spec file - general cleanup of code
* move xz/lzma helpers to separate included filesAnders F Bjorklund2012-01-271-683/+1
|
* add lzma compression supportAnders F Bjorklund2012-01-271-0/+808
|
* libxml violates the zlib interface and crashesMark Adler2010-01-191-0/+4
| | | | | * xmlIO.c: remove an abuse of zlib API and use a clean interface available in zlib >= 1.2.3
* 542394 xmlRegisterOutputCallbacks MAX_INPUT_CALLBACKDaniel Veillard2009-08-241-1/+1
| | | | * xmlIO.c: trivial fix, wrong constant
* Fix windows buildRob Richards2009-08-121-1/+8
|
* 574393 – utf-8 filename magic for compressed filesHans Breuer2009-08-111-46/+84
| | | | | * xmlIO.c: windows specific magic to have UTF-8 file name work with compressed files too.
* add a missing check in xmlAddSibling, patch by Kris Breuker avoidDaniel Veillard2009-03-231-0/+4
| | | | | | | | | * tree.c: add a missing check in xmlAddSibling, patch by Kris Breuker * xmlIO.c: avoid xmlAllocOutputBuffer using XML_BUFFER_EXACT which leads to performances problems especially on Windows. daniel svn path=/trunk/; revision=3820
* Borland C fix from Moritz Both regenerate, workaround a problem for bufferDaniel Veillard2008-09-011-8/+61
| | | | | | | | | | | | | | | | | | | * trionan.c: Borland C fix from Moritz Both * testapi.c: regenerate, workaround a problem for buffer testing * xmlIO.c HTMLtree.c: new internal entry point to hide even better xmlAllocOutputBufferInternal * tree.c: harden the code around buffer allocation schemes * parser.c: restore the warning when namespace names are not absolute URIs * runxmlconf.c: continue regression tests if we get the expected number of errors * Makefile.am: run the python tests on make check * xmlsave.c: handle the HTML documents and trees * python/libxml.c: convert python serialization to the xmlSave APIs and avoid some horrible hacks Daniel svn path=/trunk/; revision=3790
* preparing 2.7.0 release remove some testing traces remove some warningsLIBXML2.7.0Daniel Veillard2008-08-301-1/+0
| | | | | | | | | * configure.in, doc/*: preparing 2.7.0 release * tree.c: remove some testing traces * parser.c xmlIO.c xmlschemas.c: remove some warnings Daniel svn path=/trunk/; revision=3788
* make a new kind of buffer where shrinking and adding in head can avoidDaniel Veillard2008-08-301-4/+16
| | | | | | | | | | | * include/libxml/tree.h tree.c: make a new kind of buffer where shrinking and adding in head can avoid reallocation or full buffer memmoves * encoding.c xmlIO.c: use the new kind of buffers for output buffers Daniel svn path=/trunk/; revision=3787
* fix output bug reported by Petr Pajas and analyzed by Bill DanielDaniel Veillard2008-02-161-0/+11
| | | | | | | * xmlIO.c: fix output bug reported by Petr Pajas and analyzed by Bill Daniel svn path=/trunk/; revision=3695
* fixed windows path determination (patch from Roland Schwarz, bug #462877)Rob Richards2007-08-141-4/+7
| | | | | | | | | * xmlIO.c: fixed windows path determination (patch from Roland Schwarz, bug #462877) * win32/Makefile.mingw win32/configure.js: fixed mingw build (patch from Roland Schwarz, bug #462877) svn path=/trunk/; revision=3648
* workaround misgenerated file: URIs c.f. #437385 danielDaniel Veillard2007-06-121-2/+9
| | | | | | | * xmlIO.c: workaround misgenerated file: URIs c.f. #437385 daniel svn path=/trunk/; revision=3630
* Fixed typo in xmlCharEncFirstLine pointed out by Mark Rowe (bug #440159)William M. Brack2007-05-221-1/+1
| | | | | | | | | | | | * encoding.c: Fixed typo in xmlCharEncFirstLine pointed out by Mark Rowe (bug #440159) * include/libxml/xmlversion.h.in: Added check for definition of _POSIX_C_SOURCE to avoid warnings on Apple OS/X (patch from Wendy Doyle and Mark Rowe, bug #346675) * schematron.c, testapi.c, tree.c, xmlIO.c, xmlsave.c: minor changes to fix compilation warnings - no change to logic. svn path=/trunk/; revision=3618
* applied patch from Andreas Stricke to ease the compilation on Windows CEDaniel Veillard2007-04-171-1/+5
| | | | | | | | | * catalog.c libxml.h win32/wince/wincecompat.h win32/wince/wincecompat.c xmlIO.c nanohttp.c nanoftp.c trio.c triostr.c triostr.h: applied patch from Andreas Stricke to ease the compilation on Windows CE Daniel svn path=/trunk/; revision=3600
* applied change from Michael Day to avoid a problem when compiled withoutDaniel Veillard2007-03-301-6/+8
| | | | | | | | * xmlIO.c: applied change from Michael Day to avoid a problem when compiled without zlib support. Daniel svn path=/trunk/; revision=3596
* fix Windows compile - missing xmlWrapOpen.Rob Richards2006-10-121-1/+1
| | | | * xmlIO.c: fix Windows compile - missing xmlWrapOpen.
* fixed a weird error where validity context whould not show up if warningsDaniel Veillard2006-10-111-27/+26
| | | | | | | | * valid.c: fixed a weird error where validity context whould not show up if warnings were disabled pointed out by Bob Stayton * xmlIO.c doc/generator.py: cleanup and fix to regenerate the docs * doc//* testapi.c: rebuilt the docs Daniel