gstvalue: don't write to const char *
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 12 Oct 2020 23:19:47 +0000 (01:19 +0200)
committerMathieu Duponchelle <mathieu@centricular.com>
Mon, 12 Oct 2020 23:19:47 +0000 (01:19 +0200)
commit2e507d5a4b9e663157ecf75e795ddcb8ea579823
tree04e2e03ed9b3fa8698d6e390f5f5b3194f864ec5
parent4095a4b4c5dbedd97ddad0460698739efa68b3d8
gstvalue: don't write to const char *

Our various deserializing functions require NULL terminators
to not over consume substrings (eg fields of an array). Instead
of writing a NULL terminator to the passed-in string, which may
result in segfaults, make a copy of the substring we're interested
in.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/446

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/672>
gst/gstvalue.c