mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-03-13 20:58:16 +03:00
xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add, check "facet->val"
The xmlSchemaGetFacetValueAsUlong() API is an external API. The validity of external input parameters must be strictly verified. Before accessing "facet->val->value", we need check whether "facet->val" is a null pointer. Signed-off-by: wuqing <wuqing30@huawei.com> Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
This commit is contained in:
parent
84b76d99f1
commit
cb7a572b3e
@ -5142,7 +5142,7 @@ xmlSchemaGetFacetValueAsULong(xmlSchemaFacetPtr facet)
|
||||
/*
|
||||
* TODO: Check if this is a decimal.
|
||||
*/
|
||||
if (facet == NULL)
|
||||
if (facet == NULL || facet->val == NULL)
|
||||
return 0;
|
||||
return ((unsigned long) facet->val->value.decimal.lo);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user