From a6bb9b32322ceaa03a8baeee9c81a6384e30653a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=96=D1=83=D0=BC?= =?UTF-8?q?=D0=B0=D1=80=D0=B8=D0=BD?= Date: Sun, 13 May 2018 01:27:53 +0300 Subject: [PATCH] Fix segfault Fix segfault in myhtml_tree_node_clone if node->token is NULL --- source/myhtml/tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/myhtml/tree.c b/source/myhtml/tree.c index 9fd917e..46aec7b 100644 --- a/source/myhtml/tree.c +++ b/source/myhtml/tree.c @@ -516,7 +516,8 @@ myhtml_tree_node_t * myhtml_tree_node_clone(myhtml_tree_node_t* node) { myhtml_tree_node_t* new_node = myhtml_tree_node_create(node->tree); - myhtml_token_node_wait_for_done(node->tree->token, node->token); + if(node->token) + myhtml_token_node_wait_for_done(node->tree->token, node->token); new_node->token = myhtml_token_node_clone(node->tree->token, node->token, node->tree->mcasync_rules_token_id,