From: Sebastian Dröge Date: Tue, 13 Jun 2023 09:53:13 +0000 (+0300) Subject: subparse: Look for the closing `>` of a tag after the opening `<` X-Git-Tag: 1.22.7~189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=518ecba8f960137715f776dac6c93e4c4e4179d1;p=platform%2Fupstream%2Fgstreamer.git subparse: Look for the closing `>` of a tag after the opening `<` Previously when fixing up subrip markip, we were looking from the start of the remaining buffer instead. Due to how skipping over closing tags works, the remaining buffer will still contain the closing `>` of the previous tag so if a unexpected closing tag is found after another closing tag, we would potentially do an out of bounds memmove(). Fixes ZDI-CAN-20968 Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/2662 Part-of: --- diff --git a/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c b/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c index 7aa922c..d0960a9 100644 --- a/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c +++ b/subprojects/gst-plugins-base/gst/subparse/gstsubparse.c @@ -779,7 +779,7 @@ subrip_fix_up_markup (gchar ** p_txt, gconstpointer allowed_tags_ptr) } if (*next_tag == '<' && *(next_tag + 1) == '/') { - end_tag = strchr (cur, '>'); + end_tag = strchr (next_tag, '>'); if (end_tag) { const gchar *last = NULL; if (num_open_tags > 0)