Set null terminator when creating SIZED_STRING in yr_re_ast_extract_literal.
@@ -395,6 +395,7 @@ SIZED_STRING* yr_re_ast_extract_literal(
else
{
child = re_ast->root_node->children_tail;
+
while (child != NULL)
{
string->c_string[--length] = child->value;
@@ -402,6 +403,8 @@ SIZED_STRING* yr_re_ast_extract_literal(
}
}
+ string->c_string[length] = '\0';
+
return string;
}
