Commit 3c63cedb authored by Mark Shroyer's avatar Mark Shroyer Committed by The Qt Project
Browse files

Fix undefined behavior validating XSD substitution groups


A bug in XSD substitution group validation would result in an invalid
cast of SchemaType::Ptr to XsdComplexType::Ptr, in which case evaluating
complexType->prohibitedSubstitutions() exhibited undefined behavior.  In
practice this caused validation against XSD schemas containing
substitution groups to fail on some machines, where ORing the checkSet
mask against out of bounds memory could cause the function

XsdSchemaHelper::substitutionGroupOkTransitive()

to return a false negative.

Minus the bug fix, the regression test added in this commit failed on
(at least) Linux ARM when compiled with the Linaro toolchain 2013.01 g++
4.7, with flags -marm -mcpu=cortex-a8 -O2.  However, it did not fail on
a Linux amd64 machine prior to the bug fix.

Change-Id: Idd060a941a3bc0620f1fcc903375e43022bdcbdc
Reviewed-by: default avatarLars Knoll <lars.knoll@digia.com>
parent 11b150d9
Showing with 34 additions and 1 deletion
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment