flacenc: avoid potential string overflow
authorTim-Philipp Müller <tim@centricular.com>
Mon, 28 Sep 2015 19:25:22 +0000 (20:25 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 28 Sep 2015 19:25:22 +0000 (20:25 +0100)
commit6c0971029228664bcbc10d825a7988e7a45f9e71
treea9595e9ebc87772fd884d0bca6dd8c7cab9455fd
parent1cd4baa16a52d191739deff5b38bc88da67972cb
flacenc: avoid potential string overflow

We don't necessarily have full control over the input tags, so
it's possible that the ISRC tag contains a longer string than
expected, in which case we'd write over the end of the static-size
13 byte buffer that is FLAC__StreamMetadata_CueSheet_Track::isrc.
Make sure to only copy the ISRC if it's not too long, and make
sure the buffer we write to is always NUL-terminated by using
g_strlcpy().

CID 1324931.
ext/flac/gstflacenc.c