mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-26 10:03:34 +03:00
fuzz: Adjust for xmlNodeParseContent changes
xmlStringGetNodeList returns NULL again for empty strings.
This commit is contained in:
parent
1e5375c1b4
commit
de3221b179
@ -2496,7 +2496,7 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
|
||||
list = xmlStringGetNodeList(
|
||||
getDoc(0),
|
||||
value = getStr(0));
|
||||
oomReport = (value != NULL && list == NULL);
|
||||
oomReport = (value != NULL && value[0] != 0 && list == NULL);
|
||||
xmlFreeNodeList(list);
|
||||
endOp();
|
||||
break;
|
||||
@ -2514,7 +2514,7 @@ LLVMFuzzerTestOneInput(const char *data, size_t size) {
|
||||
doc,
|
||||
value,
|
||||
xmlStrlen(value));
|
||||
oomReport = (value != NULL && list == NULL);
|
||||
oomReport = (value != NULL && value[0] != 0 && list == NULL);
|
||||
xmlFreeNodeList(list);
|
||||
endOp();
|
||||
break;
|
||||
|
8
tree.c
8
tree.c
@ -1480,8 +1480,8 @@ xmlNodeParseContent(xmlNodePtr node, const xmlChar *content, int len) {
|
||||
*
|
||||
* See xmlStringGetNodeList.
|
||||
*
|
||||
* Returns a pointer to the first child or NULL if a memory
|
||||
* allocation failed.
|
||||
* Returns a pointer to the first child or NULL if the value if empty
|
||||
* or a memory allocation failed.
|
||||
*/
|
||||
xmlNodePtr
|
||||
xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) {
|
||||
@ -1507,8 +1507,8 @@ xmlStringLenGetNodeList(const xmlDoc *doc, const xmlChar *value, int len) {
|
||||
* undeclared entities will be ignored silently with unspecified
|
||||
* results.
|
||||
*
|
||||
* Returns a pointer to the first child or NULL if a memory
|
||||
* allocation failed.
|
||||
* Returns a pointer to the first child or NULL if the value if empty
|
||||
* or a memory allocation failed.
|
||||
*/
|
||||
xmlNodePtr
|
||||
xmlStringGetNodeList(const xmlDoc *doc, const xmlChar *value) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user