decoder/dsdiff: use a fixed-size buffer for the tag value
Variable-length arrays are a C-only feature.
This commit is contained in:
parent
adffbba2a5
commit
3e40b1d9d2
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user