heap-buffer-overflow, fixes #4217

This commit is contained in:
heckflosse
2017-12-08 20:40:03 +01:00
parent 503fe902a0
commit a3d59a864a

View File

@@ -1671,7 +1671,7 @@ void Tag::toString (char* buffer, int ofs)
strcpy (buffer, "");
for (size_t i = 0; i < maxcount; i++) {
for (size_t i = 0; i < std::min(maxcount, static_cast<size_t>(valuesize - ofs)); i++) {
if (i > 0) {
strcat (buffer, ", ");
}