tnccs_11: Avoid crash if TNCCS-ReasonStrings is empty or only contains empty nodes

`xmlNodeGetContent()` returns `NULL` if `child` is `NULL`, which causes
a segmentation fault in `chunk_from_str()`.

Fixes: ec1eab0319 ("fixed XML parsing of TNCCS 1.1 ReasonString message")
This commit is contained in:
Tobias Brunner
2026-04-02 08:17:05 +02:00
parent 65fcf08cdb
commit 513f25ce12
@@ -126,6 +126,11 @@ tnccs_msg_t *tnccs_reason_strings_msg_create_from_node(xmlNodePtr node,
}
break;
}
if (!child)
{
error_msg = "ReasonString tag not found";
goto fatal;
}
lang_string = xmlGetProp(child, "lang");
if (!lang_string)