The xmlOutputBufferGetContent function only returns the buffer attribute
of the _xmlOutputBuffer struct.
When the `encoder` attribute is set the content is stored in the `conv`
attribute after conversions are performed and the `buffer` attribute is
emptied. This causes the xmlOutputBufferGetContent to always return
empty when the `encoder` is set.
This patch fixes the function by returning the `conv` attribute when the
encoder is set.
Fixes: #991
Similarly to libtools, add a test setup to meson so that tests
can be run under valgrind even with meson:
meson test -C $builddir --setup valgrind
Since meson has a timeout for individual tests (30 seconds) and
valgrind makes everything run slower, the timeout needs to be
increased (factor of 4 looks good enough).
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Problem with libtools is that it produces shell scripts which
then set LD_LIBRARY_PATH and execute actual binary (hidden in
.libs dir). Therefore, running 'valgring ./testbinary' doesn't do
anything useful (beside checking for memleaks in shell). We want
to use `libtool --mode=execute valgrind ./testbinary`.
With that fixed, next step is to make valgrind return a non-zero
value if a memleak is detected (--error-exitcode=). And to show
individual memleaks let's use --leak-check=full.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This patch changes the security section in the README.md file to give
more information.
This removes the "unmaintained" text, as this project is maintained
again. It also makes it clear that this is a community project, so
anyone will know what to expect, and it also makes explicit that
developers are volunteers and will work on the issues that they want, as
a try to avoid pressure from bug reporters.
The message try to be possitive, promoting collaboration instead of
conflict. The idea is to make it clear that collaboration is welcome and
the way to go is to do it yourself instead of asking the maintainers to
do it for you.
This patch frees the cmdline when it's not empty but it doesn't contain
any actual character.
If the cmdline is just whitespaces or \r and \n, the loop continues
without freeing the cmdline string, so it's a leak.
Fix https://gitlab.gnome.org/GNOME/libxml2/-/issues/1009
I got the following error message after trying to remove my maintainer
entry from the DOAP file:
> Must have at least one doap:maintainer property with a gnome:userid
> property
So I'm adding the previous maintainer.
The deprecated attribute started accepting an optional string argument
in GCC version 4.5. Compiling libxml2 with GCC versions prior to that
would cause compilation errors such as:
```
./include/libxml/xmlmemory.h:134: error: wrong number of arguments specified for 'deprecated' attribute
```
Now the string argument is omitted for older versions of GCC.
Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
The id table shouldn't reference ids in entities. The id will be created
when expanding the entity.
Probably regressed with d025cfbb.
Note that we still register ids in entities if entities are not
replaced. This is required to make IDREF checks work.
Fixes#974.
Calling initGenericErrorDefaultFunc(NULL) currently yields to
/usr/include/libxml2/libxml/xmlerror.h:23:45: error: invalid use of void expression
23 | xmlSetGenericErrorFunc(NULL, (h) ? *(h) : NULL)
Indeed, even if h is nul, the compiler will try to give a type to *(h),
which can't work.
This allows to perform XML element validation skipping errors without recreating
a validation context. Tested it in runsuite.c in the rngTestStreaming() method.
Also added xmlRegExecClearErrors(exec) as necessary.
Use C11 atomics if available. Otherwise, fall back to pthread mutex
inlined in xmlDict struct or Win32 atomics.
This should fix lock contention reported in #970.