decoder/dsdiff: use a fixed-size buffer for the tag value

Variable-length arrays are a C-only feature.
This commit is contained in:
Max Kellermann 2019-06-06 12:32:49 +02:00
parent adffbba2a5
commit 3e40b1d9d2

View File

@ -201,10 +201,11 @@ dsdiff_handle_native_tag(InputStream &is,
uint32_t length = FromBE32(metatag.size);
/* Check and limit size of the tag to prevent a stack overflow */
if (length == 0 || length > 60)
constexpr size_t MAX_LENGTH = 60;
if (length == 0 || length > MAX_LENGTH)
return;
char string[length + 1];
char string[MAX_LENGTH + 1];
char *label;
label = string;