[xml] ping //Re: [PATCH] xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add check "facet->val"
- From: Xiaoming Ni <nixiaoming huawei com>
- To: <otaylor src gnome org>, <veillard src gnome org>, <wbrack src gnome org>, <veillard redhat com>, <igor zlatkovic com>, <rrichards ctindustries net>, <xml gnome org>
- Cc: <wangle6 huawei com>, <wuqing30 huawei com>
- Subject: [xml] ping //Re: [PATCH] xmlschemastypes.c: xmlSchemaGetFacetValueAsULong add check "facet->val"
- Date: Tue, 1 Dec 2020 15:05:05 +0800
ping
On 2020/11/24 14:55, Xiaoming Ni wrote:
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>
---
xmlschemastypes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
index d6b9f924..07b5fd76 100644
--- a/xmlschemastypes.c
+++ b/xmlschemastypes.c
@@ -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);
}
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]