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:
@@ -126,6 +126,11 @@ tnccs_msg_t *tnccs_reason_strings_msg_create_from_node(xmlNodePtr node,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (!child)
|
||||||
|
{
|
||||||
|
error_msg = "ReasonString tag not found";
|
||||||
|
goto fatal;
|
||||||
|
}
|
||||||
|
|
||||||
lang_string = xmlGetProp(child, "lang");
|
lang_string = xmlGetProp(child, "lang");
|
||||||
if (!lang_string)
|
if (!lang_string)
|
||||||
|
|||||||
Reference in New Issue
Block a user