summaryrefslogtreecommitdiff
path: root/xmlschemastypes.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2004-11-05 17:22:25 +0000
committerDaniel Veillard <veillard@src.gnome.org>2004-11-05 17:22:25 +0000
commitce682bc24b79f1dd29b781d4c17f9bf169ce7e32 (patch)
tree7994a79a3ff5039b9d3c0b8f541aeec9b24d001c /xmlschemastypes.c
parentb031cef5b537d8eda30f508627f08bc642bbd31d (diff)
downloadlibxml2-ce682bc24b79f1dd29b781d4c17f9bf169ce7e32.tar.gz
autogenerate a minimal NULL value sequence for unknown pointer types This
* gentest.py testapi.c: autogenerate a minimal NULL value sequence for unknown pointer types * HTMLparser.c SAX2.c chvalid.c encoding.c entities.c parser.c parserInternals.c relaxng.c valid.c xmlIO.c xmlreader.c xmlsave.c xmlschemas.c xmlschemastypes.c xmlstring.c xpath.c xpointer.c: This uncovered an impressive amount of entry points not checking for NULL pointers when they ought to, closing all the open gaps. Daniel
Diffstat (limited to 'xmlschemastypes.c')
-rw-r--r--xmlschemastypes.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index 9346ac69..6dd8cbbf 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -470,6 +470,8 @@ xmlSchemaCleanupTypes(void) {
int
xmlSchemaIsBuiltInTypeFacet(xmlSchemaTypePtr type, int facetType)
{
+ if (type == NULL)
+ return (-1);
if (type->type != XML_SCHEMA_TYPE_BASIC)
return (-1);
switch (type->builtInType) {
@@ -3789,6 +3791,8 @@ xmlSchemaValidateListSimpleTypeFacet(xmlSchemaFacetPtr facet,
unsigned long actualLen,
unsigned long *expectedLen)
{
+ if (facet == NULL)
+ return(-1);
/*
* TODO: Check if this will work with large numbers.
* (compare value.decimal.mi and value.decimal.hi as well?).
@@ -3844,6 +3848,8 @@ xmlSchemaValidateLengthFacet(xmlSchemaTypePtr type,
{
unsigned int len = 0;
+ if ((length == NULL) || (facet == NULL) || (type == NULL))
+ return (-1);
*length = 0;
if ((facet->type != XML_SCHEMA_FACET_LENGTH) &&
(facet->type != XML_SCHEMA_FACET_MAXLENGTH) &&
@@ -3918,6 +3924,8 @@ xmlSchemaValidateFacet(xmlSchemaTypePtr base ATTRIBUTE_UNUSED,
{
int ret;
+ if ((facet == NULL) || (value == NULL))
+ return(-1);
switch (facet->type) {
case XML_SCHEMA_FACET_PATTERN:
ret = xmlRegexpExec(facet->regexp, value);