Merge branch 'tag_stack' into 'master'

Fix use-after-free in _cairo_tag_stack_pop

See merge request cairo/cairo!483
This commit is contained in:
Uli Schlachter 2023-06-29 15:11:17 +00:00
commit 42555cb0a7

View file

@ -249,10 +249,12 @@ _cairo_tag_stack_pop (cairo_tag_stack_t *stack,
cairo_list_del (&top->link);
stack->size--;
if (strcmp (top->name, name) != 0) {
cairo_status_t status =
_cairo_tag_error ("cairo_tag_end(\"%s\") does not matching previous begin tag \"%s\"",
name, top->name);
stack->type = TAG_TYPE_INVALID;
_cairo_tag_stack_free_elem (top);
return _cairo_tag_error ("cairo_tag_end(\"%s\") does not matching previous begin tag \"%s\"",
name, top->name);
return status;
}
if (elem)