GNOME Bugzilla – Bug 651202
xmlSchemaCheckCOSNSSubset has a logic error in xmlSchemaCheckCOSNSSubset
Last modified: 2012-02-29 02:58:22 UTC
This bug was reported by a static analyzer run against the Chromium browser, which uses libxml2, with the downstream bug at http://code.google.com/p/chromium/issues/detail?id=84132 The following is the original error report: V501 There are identical sub-expressions 'sub->negNsSet->value' to the left and to the right of the '==' operator. libxml xmlschemas.c 13949 static int xmlSchemaCheckCOSNSSubset(...) { ... if ((sub->negNsSet != NULL) && (super->negNsSet != NULL) && (sub->negNsSet->value == sub->negNsSet->value)) return 0; ... } The correct check should be: if ((sub->negNsSet != NULL) && (super->negNsSet != NULL) && (sub->negNsSet->value == super->negNsSet->value)) return 0;
Created attachment 197824 [details] [review] patch from chromium's third_party/libxml/patches/ Ping? Obviously correct patch. In use in chromium's bundled copy of libxml for three months.
Okay, makes total sense, applied and pushed to git head, thanks ! Daniel