IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
Functions like xmlCleanSpecialAttr scan a hash table and possibly delete
entries in the callback. xmlHashScanFull must detect such deletions and
rescan the entry.
This regressed when rewriting the hash table code in 4a513d56.
Fixes#626.
This is a complete rewrite of the code in hash.c
Move from a chained hash table implementation to open addressing with
Robin Hood probing. This allows to increase the maximum fill factor and
further reduce the growth factor, saving considerable amounts of memory
without sacrificing performance.
To make this work, hash values are now cached in the table entry
also avoiding many key comparisons.
Tables are created lazily with a smaller minimum size.
Insertion functions now report an error if growing the table resulted in
a memory allocation failure.
Some string comparisons were optimized to call directly into libc
instead of using the xmlstring API.
The length of inserted keys is computed along with the hash improving
allocation performance.
Bounds checking was made more robust.
In dictionary-based mode, unneeded interning of strings is avoided.
Update hash function from classic Jenkins OAAT (dict.c) and a variant of
DJB2 (hash.c) to "GoodOAAT" taken from the SMHasher repo. This hash
function passes all SMHasher tests.
Introduce load factor as main trigger and increase MAX_HASH_LEN. This
should make growth behavior more predictable.
Raise size limit to INT_MAX. This avoids quadratic behavior with larger
tables.
Call xmlInitParser in xmlHashCreate to make it work if the library
wasn't initialized yet.
Otherwise, exsltRegisterAll from libxslt 1.1.24 or older might cause
a crash.
See #534.
Remove explicit integer casts as final operation
- in assignments
- when passing arguments
- when returning values
Remove casts
- to the same type
- from certain range-bound values
The main motivation is that these explicit casts don't change the result
of operations and only render UBSan's implicit-conversion checks
useless. Removing these casts allows UBSan to detect cases where
truncation or sign-changes occur unexpectedly.
Document some explicit casts as truncating and add a few missing ones.
Private functions were previously declared
- in header files in the root directory
- in public headers guarded with IN_LIBXML
- in libxml.h
- redundantly in source files that used them.
Consolidate all private header files in include/private.
Use unsigned long for temporary variable to avoid integer conversion
warnings with UBSan.
Note that this does change the computation of hash values for input
bytes larger than 0x7F. Before, these bytes were first converted to a
(typically) signed char with a negative value, then to a large unsigned
long near ULONG_MAX. I doubt that this was intentional. Input bytes
larger than 0x7F are now converted to unsigned long unchanged.
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.
tsan reported that rand() is not thread safe, so create
a thread safe wrapper, use rand_r() if available.
Consolidate the function, initialization and cleanup in
dict.c and make sure it is initialized in xmlInitParser()
Following http://www.ocert.org/advisories/ocert-2011-003.html
it seems that having hash randomization might be a good idea
when using XML with untrusted data
* configure.in: lookup for rand, srand and time
* dict.c: add randomization to dictionaries hash tables
* hash.c: add randomization to normal hash tables
* SAX2.c dict.c error.c hash.c nanohttp.c parser.c python/libxml.c
relaxng.c runtest.c tree.c valid.c xinclude.c xmlregexp.c xmlsave.c
xmlschemas.c xpath.c xpointer.c: mostly removing unneded affectations,
but this led to a few real bugs and some part not yet understood
(relaxng/interleave)
* parser.c: handle a erroneous parsing of attributes in
case said attribute has been redeclared in the DTD with a
different type
* hash.c: fix the hash scanner to not crash if a first element
from the hash list is been removed in the callback
Daniel
svn path=/trunk/; revision=3669
* 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
* hash.c include/libxml/hash.h: added xmlHashCreateDict where
the hash reuses the dictionnary for internal strings
* entities.c valid.c parser.c: reuse that new API, leads to a decent
speedup when parsing for example DocBook documents.
Daniel
* xpath.c: change suggested by Anthony Carrico when unregistering
a namespace prefix to a context
* hash.c: be more careful about calling callbacks with NULL payloads.
Daniel
* configure.in: preparing a beta3 solving the ABI problems
* globals.c parser.c parserInternals.c testHTML.c HTMLparser.c SAX.c
include/libxml/globals.h include/libxml/SAX.h: make sure the
global variables for the default SAX handler are V1 ones to
avoid ABI compat problems.
* xmlreader.c: cleanup of uneeded code
* hash.c: fix a comment
Daniel
* SAX2.c hash.c parser.c include/libxml/xmlexports.h
include/libxml/xmlmemory.h include/libxml/xmlversion.h.in:
fixing some comments to avoid warnings from apibuild.py
Daniel
* configure.in doc/* : 2.6.0beta1 changes
* SAX2.c hash.c parser.c parserInternals.c: Fixing attribute
normalization, might not be totally fixed but this should
make sure SAX event provide the right strings for attributes
except entities for which libxml2 is different by default
This should fix#109564
* result/attrib.xml.sax result/ent3.sax result/p3p.sax: minor changes
in attribute callback values
* result/c14n/with-comments/example-4
result/c14n/without-comments/example-4: this also fixes a subtle
bug in the canonicalization tests.
Daniel
fixing bugs and migrating to SAX2 interface by default. There
is some work letf TODO, like namespace validation and attributes
normalization (this break C14N right now)
* Makefile.am: fixed the test rules
* include/libxml/SAX2.h include/libxml/parser.h
include/libxml/parserInternals.h SAX2.c parser.c
parserInternals.c: changing the parser, migrating to SAX2,
adding new interface to switch back to SAX1 or initialize a
SAX block for v1 or v2. Most of the namespace work is done
below SAX, as well as attribute defaulting
* globals.c: changed initialization of the default SAX handlers
* hash.c tree.c include/libxml/hash.h: added QName specific handling
* xmlIO.c: small fix
* xmllint.c testSAX.c: provide a --sax1 switch to test the old
version code path
* result/p3p result/p3p.sax result/noent/p3p test/p3p: the new code
pointed out a typo in a very old test namespace
Daniel
* dict.c hash.c: optimization when freeing hash tables.
* parser.c xmlIO.c include/libxml/tree.h: some tuning of buffer
allocations
* parser.c parserInternals.c include/libxml/parser.h: keep a
single allocated block for all the attributes callbacks,
avoid useless malloc()/free()
* tree.c: do not realloc() when growing a buffer if the buffer
ain't full, malloc/memcpy/free avoid copying memory.
Daniel
* DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c
nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c
testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c
xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c:
code cleanup, especially the function comments.
* tree.c: fixed a small bug when freeing nodes which are XInclude ones.
Daniel
* hash.c: cosmetic cleanup
* valid.c include/libxml/tree.h include/libxml/valid.h: started
integrating a DTD validation layer based on the regexps
Daniel
* xpath.c: applied patch from Richard Jinks for the namespace
axis + fixed a memory error.
* parser.c parserInternals.c: applied patches from Peter Jacobi
removing ctxt->token for good.
* xmlschemas.c xmlschemastypes.c: fixed a few memory leaks
popped out by the regression tests.
* Makefile.am: patch for threads makefile from Gary Pennington
Daniel
* hash.c: applied a patch from Peter Jacobi to solve a problem
when compiling with the Watcom C on Win32
* result/schemas/*.err: the change of hashing algo generated
permutations in the output
Daniel
* configure.in: preparing 2.4.18
* doc/*: updated and rebuilt the web site
* *.c libxml.h: implement the new IN_LIBXML scheme discussed with
the Windows and Cygwin maintainers.
* parser.c: humm, changed the way the SAX parser work when
xmlSubstituteEntitiesDefault(1) is set, it will then
do the entity registration and loading by itself in case the
user provided SAX getEntity() returns NULL.
* testSAX.c: added --noent to test the behaviour.
Daniel
* hash.c: patch from Anthony Jones for hash.c allocation size
* Makefile.am: trying to work around Yet Another Libtool Madness
and build the 2.4.13 release finally ...
daniel