1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-13 20:58:16 +03:00

4335 Commits

Author SHA1 Message Date
Daniel Veillard
e18bce0d06 fixing a ptotential uninitialized access 2014-02-06 10:47:20 +01:00
Daniel Veillard
15d12040ff Fix an fd leak in an error case 2014-02-06 10:38:00 +01:00
Daniel Veillard
054c716ea1 Missing initialization for the catalog module 2014-01-26 15:02:25 +01:00
Nick Wellnhofer
03c6723043 Handling of XPath function arguments in error case
The XPath engine tries to guarantee that every XPath function can pop
'nargs' non-NULL values off the stack. libxslt, for example, relies on
this assumption. But the check isn't thorough enough if there are errors
during the evaluation of arguments. This can lead to segfaults:

https://mail.gnome.org/archives/xslt/2013-December/msg00005.html

This commit makes the handling of function arguments more robust.

* Bail out early when evaluation of XPath function arguments fails.
* Make sure that there are 'nargs' arguments in the current call frame.
2013-12-20 17:45:04 +01:00
Jacob (Jouk) Jansen
4d041a2e80 Various portability patches for OpenVMS
Available from http://nchrem.tnw.tudelft.nl/openvms/software2.html
2013-12-17 15:33:50 +08:00
Patrick Monnerat
437f4f5977 Use specific macros for portability to OS/400
Some of the entry points for POSIX networking calls in OS/400
differs slightly due to not using const arguments
2013-12-12 15:23:09 +08:00
Patrick Monnerat
d1c0cc9908 Add macros needed for OS/400 portability 2013-12-12 15:14:47 +08:00
Patrick Monnerat
1c43f43ce3 Portability patch for fopen on OS/400 2013-12-12 15:12:53 +08:00
Patrick Monnerat
ca9fc43bf7 Portability fixes for OS/400 2013-12-12 15:11:40 +08:00
Patrick Monnerat
0f7a26d844 Improve va_list portability
Support for va_list declared as an array (cannot be referenced
explicitly)
2013-12-12 15:04:43 +08:00
Patrick Monnerat
147aaf21ea Portability fix
Don't assume fileno for stdin and stdout are 0 and 1
2013-12-12 15:02:40 +08:00
Patrick Monnerat
3a76bfedde Portability fix
increase internal use of a portability macro
2013-12-12 15:01:53 +08:00
Patrick Monnerat
66693cef33 Generic portability fix
Undefine common symbol before redefining them
2013-12-12 15:00:46 +08:00
Patrick Monnerat
44313c0a7e Shortening lines in headers
no change of semantic
2013-12-12 14:59:18 +08:00
Daniel Veillard
e59c244e73 Add limitations about encoding conversion 2013-12-11 00:01:38 +08: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
Jan Pokorný
761c9e9901 Get rid of 'REPLACEMENT CHARACTER' Unicode chars in xmlschemas.c
Middle dot pairs (as in [1]) turned to grave accents/backticks,
section signs to dollars (for compatibility with ASCII).

[1] http://www.w3.org/TR/xmlschema-1/

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2013-11-30 20:03:52 +08:00
Jan Pokorný
7a7cad6ed4 Fix typos in xmlschemas{,types}.c
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2013-11-30 20:03:52 +08:00
Jan Pokorný
9a85d40cef Fix incorrect spelling entites->entities
Partially, a follow-up of 81d7a8245cf9a31a49499a5a195c2b89e6f91180.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2013-11-30 20:03:52 +08:00
Gaurav
98a4e7128b Fix a couple of missing NULL checks
For https://bugzilla.gnome.org/show_bug.cgi?id=708681
2013-11-29 23:28:21 +08:00
Gaurav
080a22c5ea Avoid a possibility of dangling encoding handler
For https://bugzilla.gnome.org/show_bug.cgi?id=711149

In Function:
int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler)

If the freed handler is any one of handlers[i] list, then it will make that
hanldlers[i] as dangling. This may lead to crash issues at places where
handlers is read.
2013-11-29 23:10:50 +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
Mike Alexander
a1313a6f8c Fix a bug loading some compressed files
For https://bugzilla.gnome.org/show_bug.cgi?id=712528
Related to https://bugzilla.redhat.com/show_bug.cgi?id=877567

There is a bug in xzlib.c which causes certain compressed XML files to fail to
load correctly.  The code in xz_decomp which attempts to verify the checksum
and length of the expanded data fails if the checksum or length at the end of
the file crosses a 1024 byte boundary.  It calls gz_next4 to get those two
values.  This function uses the stream state in state->zstrm, but calls
xz_avail which uses the state->strm stream info.  This causes gz_next4 to
signal a premature EOF if the data it is fetching crosses a 1024 byte boundary.
2013-11-28 23:21:23 +08:00
Gaurav
fcd4583189 Fix XPath node comparison bug
For https://bugzilla.gnome.org/show_bug.cgi?id=715143
2013-11-28 23:01:44 +08:00
Gaurav
f3d79416d7 Type mismatch in xmlschemas.c
For https://bugzilla.gnome.org/show_bug.cgi?id=715152
2013-11-28 22:53:54 +08:00
Gaurav
e79226ccdb Type mismatch in xmlschemastypes.c
For https://bugzilla.gnome.org/show_bug.cgi?id=715152
2013-11-28 22:50:57 +08:00
Shaun McCance
6473a41a49 Implement choice for name classes on attributes
https://bugzilla.gnome.org/show_bug.cgi?id=710744
2013-11-28 16:09:00 +08:00
Philip Withnall
f3f86ff465 build: Use pkg-config to find liblzma in preference to AC_CHECK_LIB
This means that liblzma’s Libs.private will be included in LZMA_LIBS if
linking the libraries statically, ensuring that there are no undefined
symbol errors from liblzma’s private libraries.

If pkg-config isn’t installed, or if liblzma.pc couldn’t be found, fall
back to using AC_CHECK_LIB as before. This will cause static linking to
fail, but that’s not a regression.

This does not introduce a compile time dependency on pkg-config.

https://bugzilla.gnome.org/show_bug.cgi?id=711026
2013-11-28 16:01:13 +08:00
Philip Withnall
f859d9a783 build: Add @LZMA_LIBS@ to libxml’s pkg-config files
If libxml2 is built and linked against liblzma, the latter needs to appear in
libxml2’s Libs.private pkg-config field, otherwise static linking against
libxml2 will fail due to unresolved liblzma symbols.

https://bugzilla.gnome.org/show_bug.cgi?id=711026
2013-10-29 17:35:36 +08:00
Daniel Veillard
4b61cf61e7 fix some tabs mixing incompatible with python3
Patrick Welche <prlw1@cam.ac.uk> raised this issue
2013-10-02 22:18:21 +08:00
Gaurav
7d4e259fbf Avoid some dead code and cleanup in relaxng.c
https://bugzilla.gnome.org/show_bug.cgi?id=705388

Code needed a bit of cleanup
2013-09-30 11:27:41 +08:00
Daniel Veillard
b8bdc258de Avoid a deadcode in catalog.c
For https://bugzilla.gnome.org/show_bug.cgi?id=703504
2013-09-30 11:12:04 +08:00
Denis Pauk
0146179120 Drop not needed checks
https://bugzilla.gnome.org/show_bug.cgi?id=704075
2013-09-30 10:57:35 +08:00
Denis Pauk
283c83e0d3 run close socket on Solaris, same as we do on other platforms
https://bugzilla.gnome.org/show_bug.cgi?id=705188
2013-09-30 10:51:42 +08:00
Gaurav
c570b37972 Fix pointer dereferenced before null check
for https://bugzilla.gnome.org/show_bug.cgi?id=708364

xmlValidateElementContent is a private function but should still
check the ctxt argument before dereferencing
2013-09-30 10:43:47 +08:00
Daniel Veillard
75d13092f2 Fix a potential NULL dereference in tree code
https://bugzilla.gnome.org/show_bug.cgi?id=707750

Also reported by Gaurav, simple fix to check the pointer before
dereference
2013-09-11 15:11:27 +08:00
Gaurav
2671b013d8 Fix potential NULL pointer dereferences in regexp code
https://bugzilla.gnome.org/show_bug.cgi?id=707749

Fix 3 cases where we might dereference NULL
2013-09-11 14:59:06 +08:00
Tim Galeckas
2205ff4b0d xmllint --pretty crashed without following numeric argument
https://bugzilla.gnome.org/show_bug.cgi?id=674789

We need to check for NULL argument before calling atoi()
2013-08-29 16:44:33 +08:00
Nick Wellnhofer
e8de99f90c Fix XPath expressions of the form '@ns:*'
Use namespace for match-all queries on the attribute axis.
2013-08-05 01:26:25 +02:00
Nick Wellnhofer
b4bcba23f6 Fix XPath '//' optimization with predicates
My attempt to optimize XPath expressions containing '//' caused a
regression reported in bug #695699. This commit disables the
optimization for expressions of the form '//foo[predicate]'.
2013-08-05 00:15:11 +02:00
Daniel Veillard
ff76eb28c7 Clear up a potential NULL dereference
https://bugzilla.gnome.org/show_bug.cgi?id=705399

if ctxt->node_seq.buffer is null then ctxt->node_seq.maximum ought
to be zero but it's better to clarify the check in the code directly.
2013-08-03 22:25:13 +08:00
Gaurav
a885f13a67 Fix a possible NULL dereference
https://bugzilla.gnome.org/show_bug.cgi?id=705400
In case of allocation error the pointer was dereferenced before the
test for a failure
2013-08-03 22:16:02 +08:00
Denis Pauk
e28c8a1ace #705267 - add additional defines checks for support "./configure --with-minimum"
https://bugzilla.gnome.org/show_bug.cgi?id=705267
2013-08-03 22:00:17 +08:00
Daniel Veillard
717042d2ae Avoid crash if allocation fails
https://bugzilla.gnome.org/show_bug.cgi?id=704527
xmlSchemaNewValue() may fail on OOM error
2013-07-22 14:28:20 +08:00
Daniel Veillard
ccc9cf9276 Fix a wrong test
https://bugzilla.gnome.org/show_bug.cgi?id=704530

Arg is an array on the stack and can't be NULL
2013-07-22 14:24:16 +08:00
Daniel Veillard
b9e4d5b639 Remove occasional leading space in XPath number formatting
https://bugzilla.gnome.org/show_bug.cgi?id=704528

Somehow snprintf "%*.*e" can generate a leading space, remove it
2013-07-22 13:21:31 +08:00
Daniel Veillard
81b961788a Two smal namespace tweaks
An improvement of the documentation, and an extra safety check
for xmlSetNs()
2013-07-22 13:01:11 +08:00
Daniel Veillard
b98c6a0ac6 Fix handling of mmap errors
https://bugzilla.gnome.org/show_bug.cgi?id=702320

as raised by Gaurav <ya1gaurav@gmail.com>
2013-07-12 12:08:40 +08:00
Arfrever Frehtes Taifersar Arahesis
6dd7775f35 Another round of fixes for older versions of Python 2013-07-12 11:18:11 +08:00
Daniel Veillard
e71dce18a1 Catch malloc error and exit accordingly
As pointed privately by Bill Parker <wp02855@gmail.com>
2013-07-11 15:41:22 +08:00