1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00
Commit Graph

132 Commits

Author SHA1 Message Date
Nick Wellnhofer
5eeb9d5fbb Fix memory leak in xmlSchemaValAtomicType
Don't collapse anyUris twice.

Closes #104.
2019-10-14 16:35:00 +02:00
Jared Yanovich
2a350ee9b4 Large batch of typo fixes
Closes #109.
2019-09-30 18:04:38 +02:00
Nick Wellnhofer
6705f4d28e Remove executable bit from non-executable files 2019-09-16 15:48:59 +02:00
Nick Wellnhofer
8efc5b283c 14:00 is a valid timezone for xs:dateTime
Closes #100
2019-09-13 12:24:23 +02:00
Nick Wellnhofer
e3f1c7f751 Partial fix for comparison of xs:durations
See https://bugzilla.gnome.org/show_bug.cgi?id=777139

Thanks to Zhongyuan Zhou for the initial merge request !34.
2019-08-25 14:12:23 +02:00
Jens Eggerstedt
b3a95d57f2 Fix unsigned int overflow 2019-07-08 12:26:06 +02: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
J. Peter Mugaas
d2c329a9a4 Fix -Wimplicit-fallthrough warnings
Add "falls through" comments to quench implicit-fallthrough warnings
which are enabled by -Wextra under GCC 7.
2017-10-21 13:49:31 +02:00
Stéphane Michaut
454e397eb7 Porting libxml2 on zOS encoding of code
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
2017-08-28 14:30:43 +02:00
Patrick Monnerat
90da33cebe Portability to non C99 compliant compilers
OS400 C compiler is not C99 compliant.
It only supports local variable declarations at the beginning of a block.
We loose the const as a result but portability is more important.
2016-05-03 21:37:52 +08:00
Patrick Monnerat
a1dca81df7 xmlschemastypes.c: accept endOfDayFrag Times set to "24:00:00" mean "end of day" and should not cause an error. 2016-05-01 18:43:40 +08:00
Audric Schiltknecht
cad102b861 Do normalize string-based datatype value in RelaxNG facet checking
Original patch is from Jan Pokorný <jpokorny redhat com>
https://mail.gnome.org/archives/xml/2013-November/msg00028.html

Improve it according to reviews and add test files.
2016-04-15 22:41:24 +08:00
Philip Withnall
4ba5d31769 xmlschemastypes: Fix potential array overflow
The year and month need validating before being put into the
MAX_DAYINMONTH macro.

Coverity issue: #60436

https://bugzilla.gnome.org/show_bug.cgi?id=731990
2014-07-26 20:20:11 +08:00
David Kilzer
30cf439efc Check for tmon in _xmlSchemaDateAdd() is incorrect
For https://bugzilla.gnome.org/show_bug.cgi?id=732705
In _xmlSchemaDateAdd(), the check for |tmon| should be the following
since MAX_DAYINMONTH() expects a month in the range [1,12]:

    if (tmon < 1)
	tmon = 1;

Regression introduced in
https://git.gnome.org/browse/libxml2/commit/?id=14b5643947845df089376106517c4f7ba061e4b0
2014-07-14 22:29:56 +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
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
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
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
Nico Weber
aae48e64df Fix a wrong enum type use in Schemas Types 2012-02-29 09:44:35 +08:00
Daniel Veillard
bbcf1275fe Fix a schema type duration comparison overflow
https://bugzilla.gnome.org/show_bug.cgi?id=653724

Based on the fix suggested by Nick Pope <nick@nickpope.me.uk>
but just changing the casts to avoid using long long type
2011-11-10 23:23:10 +08:00
Daniel Veillard
1ea9590046 Small code cleanup on previous patch
suggested by Andrew Nosenko
2010-07-28 14:49:55 +02:00
Csaba Raduly
5f8f5e7add Fix errors in XSD double validation check
- xmlschemastypes.c: "e" and "E" should not be accespted as is, digits
  are needed
2010-07-28 11:41:23 +02:00
Vincent Lefevre
933e5de96c Bug 565747 – relax anyURI data character checking
* xmlschemastypes.c: anyURI values that contain an apostrophe or a
  space character or any non-ascii char were rejected, this is opposed
  to XSD-1.0 datatype rules
2009-08-07 16:42:24 +02:00
Daniel Veillard
bfc42632b7 horror around the definition of the lexical values for decimal and derived
* xmlschemastypes.c: horror around the definition of the lexical
  values for decimal and derived types, fixing to reject empty 
  values, should fix #503268
Daniel

svn path=/trunk/; revision=3728
2008-04-03 10:43:52 +00:00
Daniel Veillard
26ab0e6c73 applied patch from Mikhail Zabaluev to separate library flags for shared
* libxml-2.0.pc.in: applied patch from Mikhail Zabaluev to separate
  library flags for shared and static builds, fixes #344594. If this
  bites you, use xml2-config.
Daniel
2006-10-11 12:32:51 +00:00
Daniel Veillard
14b5643947 more cleanups based on coverity reports. Daniel
* relaxng.c xmlschemas.c xmlschemastypes.c: more cleanups based
  on coverity reports.
Daniel
2006-03-09 18:41:40 +00:00
Kasimier T. Buchcik
1869be5690 Fixed xs:boolean to reject the empty string (reported by Bas Driessen on
* xmlschemas.c xmlschemastypes.c: Fixed xs:boolean to reject
  the empty string (reported by Bas Driessen on the mailing-list).
  Fixed schema XSI-acquisition and construction: the schemata
  (xmlSchema) didn't get the targetNamespace in some cases, thus
  the component resolution mechanism failed to work. The XSI
  stuff needs to be tested more intensively; think about how
  to test this for regression.
2006-02-20 13:37:55 +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
Kasimier T. Buchcik
72f50c18d9 Fixed parsing of xs:decimal to allow/deny special lexical forms. Fixed the
* xmlschemastypes.c: Fixed parsing of xs:decimal to
  allow/deny special lexical forms. Fixed the totalDigits
  for values in the range (x < 1) &&  (x > -1) && (x != 0);
  E.g "0.123" has now a totalDigits of 3 (was 4 previously).
  Adjusted the comparison function for decimals due to this
  change. As a side effect comparison against zeroes was
  optimized.
2005-11-28 16:36:30 +00:00
Daniel Veillard
5e9576a492 Albert Chin found another signed/unsigned problem in the date and time
* xmlschemastypes.c: Albert Chin found another signed/unsigned problem
  in the date and time code raised on IRIX 6.5
Daniel
2005-11-21 11:23:47 +00:00
Kasimier T. Buchcik
69dea3a0c0 Fixed the type of the totalDigits value to be positiveInteger. Fixed crash
* xmlschemas.c xmlschemastypes.c: Fixed the type of the
  totalDigits value to be positiveInteger.
  Fixed crash in an error report function when we gave it
  the document node; only element and attribute nodes are
  processed now (reported by Rob Richards).
2005-11-07 14:02:44 +00:00
Daniel Veillard
4f917e2416 applied patch from Kuba Nowakowski fixing bug #313982 also added the test
* xmlschemastypes.c: applied patch from Kuba Nowakowski fixing bug
  #313982
* result/schemas/bug313982* test/schemas/bug313982*: also added
  the test case to the regression suite.
Daniel
2005-08-22 16:01:43 +00:00
Daniel Veillard
9e2110bbff applied patch from Marcus Boerger to remove warnings on Windows. Daniel
* nanoftp.c nanohttp.c xmlschemastypes.c: applied patch from
  Marcus Boerger to remove warnings on Windows.
Daniel
2005-08-08 20:33:54 +00:00
Kasimier T. Buchcik
11162b7ce7 Added creation of the content type of xs:anyType. This is needed when
* xmlschemastypes.c: Added creation of the content type of
  xs:anyType. This is needed when trying to extend xs:anyType
  (although it makes no sense to extend it; IMHO the schema
  people should have ruled this out). This was reported
  by Yong Chen to the mailing list.
* xmlschemas.c: Fixed handling of xs:anyType in
  xmlSchemaCheckCOSCTExtends() (reported by Young Chen). Tiny
  adjustment to an error report output.
* test/schemas/extension2* result/schemas/extension2*:
  Added a test case provided by Young Chen.
2005-07-28 00:50:22 +00:00
Daniel Veillard
d369b1387e found the last bug raised by NIST tests in comparing base64 strings,
* xmlschemastypes.c: found the last bug raised by NIST tests in
  comparing base64 strings, result from runsuite:
  ## NIST test suite for Schemas version NIST2004-01-14
  Ran 23170 tests (3953 schemata), no errors
Daniel
2005-07-14 15:54:44 +00:00
Kasimier T. Buchcik
6d30ff2c08 Fixed bug #309338, reported by Kupriyanov Anotolij. Added a regression
* xmlschemastypes.c: Fixed bug #309338, reported by Kupriyanov
  Anotolij.
* test/schemas/bug309338* result/schemas/bug309338*:
  Added a regression test for the above bug.
2005-07-06 11:44:51 +00:00
Kasimier T. Buchcik
7f6e02432d Added missing function descriptions.
* xmlschemastypes.c: Added missing function descriptions.
2005-06-15 13:36:10 +00:00
Kasimier T. Buchcik
1c720df4e5 Changed non-prefixed QNames to be bound to a default namespace if
* xmlschemastypes.c: Changed non-prefixed QNames to be bound to a
  default namespace if existent.
2005-06-09 14:54:59 +00:00
Kasimier T. Buchcik
8dd1e1bcad Fixed a bug which I invented: hexBinary's string values were not
* xmlschemastypes.c: Fixed a bug which I invented: hexBinary's string
  values were not duplicated corrently when creating a computed value
  in xmlSchemaValAtomicType.
2005-06-09 13:14:38 +00:00
Kasimier T. Buchcik
4efd90d9c3 Changed the validation process to be able to work in streaming mode. Some
* xmlschemas.c xmlschemastypes.c include/libxml/schemasInternals.h
  include/libxml/xmlschemastypes.h: Changed the validation process
  to be able to work in streaming mode. Some datatype fixes,
  especially for list and union types. Due to the changes the
  error report output has changed in most cases. Initial migration to
  functions usable by both, the parser and the validator. This should
  ease a yet-to-come XS construction API in the long term as well.
2005-06-09 10:32:53 +00:00
Kasimier T. Buchcik
bd6c3f7df8 Fixed facet errors to be channelled back for union type members;
* xmlschemas.c: Fixed facet errors to be channelled back for
  union type members; facet-validation will stop now on the
  first error. Reported by GUY Fabrice to the mailing-list.
* xmlschemastypes.c: Changed to ignore lengh-related facet
  validation for QNames and NOTATIONs as proposed by the
  schema people.
* test/schemas/union2* result/schemas/union2*: Added
  regression tests for union types (by GUY Fabrice).
2005-05-25 17:29:36 +00:00
Kasimier T. Buchcik
690a68095f Changed the VALID_TZO macro to restrict the timezone to -840 to 840.
* xmlschemastypes.c: Changed the VALID_TZO macro to restrict
  the timezone to -840 to 840.
2005-05-12 13:16:01 +00:00
Kasimier T. Buchcik
285b36722a Applied patch from Steve Nairn (bug #303670) for "signed int" of the
* xmlschemastypes.c: Applied patch from Steve Nairn (bug #303670)
  for "signed int" of the date-time timezone field. Silenced
  a warning.
2005-05-12 13:10:22 +00:00
Kasimier T. Buchcik
64dc4d2c5b Fixed date-time related validation (reported by David Crossley, bug
* xmlschemastypes.c: Fixed date-time related validation
  (reported by David Crossley, bug #300576).
2005-04-19 15:58:31 +00:00
Kasimier T. Buchcik
c872afbd82 Added output of canonical values in identity-constraint error messages.
* xmlschemas.c: Added output of canonical values in
  identity-constraint error messages.
* xmlschemastypes.c include/libxml/xmlschemastypes.h:
  Added xmlSchemaGetCanonValueWhtsp() to the API.
  Further enhancement of the canonical value
  conversion.
* test/schemas/changelog093_0.*: Added test with an XSD
  submitted by Randy J. Ray.
2005-04-18 10:57:04 +00:00
Daniel Veillard
bda5957667 fixed a lack of comment and missing test for a pointer in the API. Daniel
* xmlschemastypes.c: fixed a lack of comment and missing test for
  a pointer in the API.
Daniel
2005-04-01 17:15:17 +00:00
Kasimier T. Buchcik
aba15f7670 Corrected 'length' facet validation for QNames and notations. Corrected
* xmlschemastypes.c: Corrected 'length' facet validation for
  QNames and notations. Corrected xmlSchemaGetCanonValue: some
  data types did not return a value if already in normalized
  form.
* xmlschemas.c include/libxml/schemasInternals.h:
  Eliminated creation of structs for <restriction>, <extension>,
  <simpleContent>, <complexContent>, <list> and <union>: the
  information is now set directly on the corresponding simple/
  complex type. Added some more complex type constraints.
  Added facet derivation constraints. Introduced "particle"
  components, which seem to be really needed if applying
  constraints. Corrected/change some of the parsing functions.
  This is all a bit scary, since a significant change to the code.
* result/schemas/src-element2-*.err result/schemas/element-*.err:
  Adapted regression test results.
2005-04-01 15:17:27 +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
Daniel Veillard
cc5e2330ef more debug messages from Matthew Burgess xmlSchemaValidateLengthFacet API
* xmlschemas.c: more debug messages from Matthew Burgess
* xmlschemastypes.c: xmlSchemaValidateLengthFacet API missing check.
Daniel
2005-03-16 21:55:35 +00:00
Kasimier T. Buchcik
9dbb0ceaca Aaaannnd putting back the previous changes done by Daniel, which I
* xmlschemastypes.c: Aaaannnd putting back the previous changes done
  by Daniel, which I overwrote with the previous commit.
2005-03-16 16:39:23 +00:00