]> git.sesse.net Git - ffmpeg/commit
avfilter/graphparser: Don't set pointer to one beyond '\0' of string
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 22 Aug 2020 22:31:17 +0000 (00:31 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 23 Aug 2020 17:57:42 +0000 (19:57 +0200)
commitf33faa5b9bfb288f83db034fa1f8719ab8a994c6
treedf8e9bfbc626e32904b7bdcb764ad8c4cc9f509b
parentb3f6dee728c2741388638f8343379bf0f0ef5946
avfilter/graphparser: Don't set pointer to one beyond '\0' of string

This happened in parse_link_name() if there was a '[' without matching
']'. While this is not undefined behaviour (pointer arithmetic one
beyond the end of an array works fine as long as there are no accesses),
it is potentially dangerous. It currently isn't (all callers of
parse_link_name() treat this as an error and don't access the string any
more), but making sure that this will never cause trouble in the future
seems nevertheless worthwhile.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavfilter/graphparser.c