Merge pull request #49 from Azq2/patch-6

fix segfault in myhtml_get_nodes_by_name_in_scope
This commit is contained in:
Alexander 2018-05-20 19:54:28 +03:00 committed by GitHub
commit 3a36d7cbfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -429,6 +429,9 @@ myhtml_collection_t * myhtml_get_nodes_by_tag_id_in_scope(myhtml_tree_t* tree, m
myhtml_collection_t * myhtml_get_nodes_by_name_in_scope(myhtml_tree_t* tree, myhtml_collection_t *collection, myhtml_tree_node_t *node, const char* html, size_t length, mystatus_t *status) myhtml_collection_t * myhtml_get_nodes_by_name_in_scope(myhtml_tree_t* tree, myhtml_collection_t *collection, myhtml_tree_node_t *node, const char* html, size_t length, mystatus_t *status)
{ {
const myhtml_tag_context_t *tag_ctx = myhtml_tag_get_by_name(tree->tags, html, length); const myhtml_tag_context_t *tag_ctx = myhtml_tag_get_by_name(tree->tags, html, length);
if(tag_ctx == NULL) {
return NULL;
}
return myhtml_get_nodes_by_tag_id_in_scope(tree, collection, node, tag_ctx->id, status); return myhtml_get_nodes_by_tag_id_in_scope(tree, collection, node, tag_ctx->id, status);
} }