libextractor

GNU libextractor
Log | Files | Refs | Submodules | README | LICENSE

commit 2e994884cc62fe321a5bdc7791d992306b28ce91
parent 22104c21d0308e912d0b59ed26db44613080e59f
Author: Christian Grothoff <christian@grothoff.org>
Date:   Tue, 30 Jun 2026 18:43:04 +0200

handle NULL returns from libtidy

Diffstat:
Msrc/plugins/html_extractor.c | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/plugins/html_extractor.c b/src/plugins/html_extractor.c @@ -264,6 +264,8 @@ EXTRACTOR_html_extract_method (struct EXTRACTOR_ExtractContext *ec) case TidyNode_Start: case TidyNode_StartEnd: name = tidyNodeGetName (child); + if (NULL == name) + break; if ( (0 == strcasecmp (name, "title")) && (NULL != (title = tidyGetChild (child))) ) { @@ -291,13 +293,18 @@ EXTRACTOR_html_extract_method (struct EXTRACTOR_ExtractContext *ec) if (NULL == (attr = tidyAttrGetById (child, TidyAttr_NAME))) break; + name = tidyAttrValue (attr); + if (NULL == name) + break; if (EXTRACTOR_METATYPE_RESERVED == - (type = tag_to_type (tidyAttrValue (attr)))) + (type = tag_to_type (name))) break; if (NULL == (attr = tidyAttrGetById (child, TidyAttr_CONTENT))) break; name = tidyAttrValue (attr); + if (NULL == name) + break; if (0 != ec->proc (ec->cls, "html",