After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 300576 - xmllint --relaxng fails to report error with date YYYY-MM-DD e.g. 2004-20-09
xmllint --relaxng fails to report error with date YYYY-MM-DD e.g. 2004-20-09
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: relaxng
2.6.19
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-04-14 04:59 UTC by David Crossley
Modified: 2017-06-12 19:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gzipped tar (1.01 KB, application/x-gzip)
2005-04-14 05:02 UTC, David Crossley
Details

Description David Crossley 2005-04-14 04:59:56 UTC
Please describe the problem:
Some bad dates are not being reported as an error.

Steps to reproduce:
[localhost]$ cat date.xml
<?xml version="1.0"?>
<dates>
  <!-- valid YYYY-MM-DD -->
  <date>2004-09-16</date>
  <date>2004-09</date>
                                                                               
  <!-- invalid YYYY-MM-DD : bad month : does report an error okay -->
  <date>2004-16-09</date>
  <date>2004-16</date>
                                                                               
  <!-- invalid YYYY-MM-DD : bad month : does *not* report an error!! -->
  <date>2004-20-09</date>
  <date>2004-20</date>
</dates>

[localhost]$ xmllint --noout --relaxng date.rng date.xml



Actual results:
The date 2004-16-09 is properly reported as an error. However the date
2004-20-09 is *not* reported as an error.

Expected results:
Both dates should be reported.

Does this happen every time?
Yes

Other information:
Doing the same test using Jing rather than xmllint, both errors are properly
reported.
Comment 1 David Crossley 2005-04-14 05:02:54 UTC
Created attachment 45238 [details]
gzipped tar

includes: date.xml and date.rng
Comment 2 kbuchcik 2005-04-19 16:02:47 UTC
Due to an integer overflow, the number 20 for the month failed to be recognized
as invalid. The fields of the _xmlSchemaValDate struct are explicitely limited
to the minimum bits needed, thus 20 was enough to overflow.

Fixed in CVS for "months", "days", and "minutes" (xmlschemastypes.c rev. 1.89). 

Thanks for the report!
Comment 3 Daniel Veillard 2005-09-05 09:02:09 UTC
This should be closed by release of libxml2-2.6.21,

  thanks,

Daniel