diff --git a/src/util-file-decompression.c b/src/util-file-decompression.c index ffff78e388..9d7af2edf1 100644 --- a/src/util-file-decompression.c +++ b/src/util-file-decompression.c @@ -169,7 +169,10 @@ int FileSwfDecompression(const uint8_t *buffer, uint32_t buffer_len, * | LZMA properties | Uncompressed length | Compressed data | */ compressed_data_len += 13; - uint8_t compressed_data[compressed_data_len]; + uint8_t *compressed_data = SCCalloc(1, compressed_data_len); + if (compressed_data == NULL) { + goto error; + } /* put lzma properties */ memcpy(compressed_data, buffer + 12, 5); /* put lzma end marker */ @@ -183,6 +186,7 @@ int FileSwfDecompression(const uint8_t *buffer, uint32_t buffer_len, r = FileSwfLzmaDecompression(det_ctx, compressed_data, compressed_data_len, out_buffer->buf + 8, out_buffer->len - 8); + SCFree(compressed_data); if (r == 0) goto error; } else {