fix serialization segfault

This commit is contained in:
Кирилл Жумарин 2018-06-02 11:56:41 +03:00 committed by GitHub
parent 307b9630e0
commit 7725ed2441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -149,13 +149,13 @@ mystatus_t myhtml_serialization_node_callback(myhtml_tree_node_t* node, mycore_c
attr = attr->next;
if (attr) {
if(attr) {
myhtml_tree_attr_t *system_id = NULL, *public_id = NULL;
if (attr->value.length == 6) {
if (mycore_strcasecmp(attr->value.data, "SYSTEM") == 0) {
if(attr->value.length == 6) {
if(mycore_strcasecmp(attr->value.data, "SYSTEM") == 0) {
system_id = attr->next;
} else if (mycore_strcasecmp(attr->value.data, "PUBLIC") == 0) {
} else if(mycore_strcasecmp(attr->value.data, "PUBLIC") == 0) {
public_id = attr->next;
system_id = public_id ? public_id->next : NULL;
}