Commit 3e40b1d9 authored by Max Kellermann's avatar Max Kellermann

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

Variable-length arrays are a C-only feature.
parent adffbba2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment