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 715152 - Type mismatch in xmlschemastypes.c and xmlschemas.c
Type mismatch in xmlschemastypes.c and xmlschemas.c
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal major
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2013-11-25 11:24 UTC by Gaurav
Modified: 2013-11-28 14:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix for Reported Bug. (476 bytes, patch)
2013-11-25 11:24 UTC, Gaurav
none Details | Review
Fix for Reported Bug. (417 bytes, patch)
2013-11-25 11:25 UTC, Gaurav
none Details | Review

Description Gaurav 2013-11-25 11:24:53 UTC
Created attachment 261422 [details] [review]
Fix for Reported Bug.

In File : https://git.gnome.org/browse/libxml2/tree/xmlschemastypes.c
Function : xmlSchemaCompareValues

if (y->type == XML_SCHEMAS_STRING)
	yws = XML_SCHEMA_WHITESPACE_PRESERVE;
    else if (x->type == XML_SCHEMAS_NORMSTRING)
        yws = XML_SCHEMA_WHITESPACE_REPLACE;
    else
        yws = XML_SCHEMA_WHITESPACE_COLLAPSE;

In above else if condition, it should check y->type, instead of x->type.


In File: https://git.gnome.org/browse/libxml2/tree/xmlschemas.c
In function : xmlSchemaParseImport

if (xmlSchemaPValAttr(pctxt, NULL, node,
	"schemaLocation", xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI),
	&schemaLocation) != 0) {
	xmlSchemaPSimpleTypeErr(pctxt,
	    XML_SCHEMAP_S4S_ATTR_INVALID_VALUE,
	    NULL, node,
	    xmlSchemaGetBuiltInType (XML_SCHEMAS_ANYURI),
	    NULL, namespaceName, NULL, NULL, NULL);


It should be like:
xmlSchemaPSimpleTypeErr(pctxt,
	    XML_SCHEMAP_S4S_ATTR_INVALID_VALUE,
	    NULL, node,
	    xmlSchemaGetBuiltInType(XML_SCHEMAS_ANYURI),
	    NULL, schemaLocation, NULL, NULL, NULL);

i.e value should be schemaLocation instead of namespaceName.


Please find attached patches for this.
Comment 1 Gaurav 2013-11-25 11:25:41 UTC
Created attachment 261423 [details] [review]
Fix for Reported Bug.
Comment 2 Daniel Veillard 2013-11-28 14:57:42 UTC
Looks right indeed, thanks for the report, fixed upstream in

https://git.gnome.org/browse/libxml2/commit/?id=e79226ccdb377cb61fdee69aaf366bb9c5838de9

and

https://git.gnome.org/browse/libxml2/commit/?id=f3d79416d792ee879b952430fc8e3311c050e218

 thanks !

Daniel