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>
Tue, 29 Sep 2015 10:19:03 +0000 (11:19 +0100)
commit8a86b26424212d79011a2587bc4571bb2161f479
treea5a12ed8f1f20e96d4b26e01775230615fe63e28
parent0413802c6057b6c65481274cfef463f63042ad0b
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