SHA256
1
0
forked from pool/qemu
qemu/brotli-fix-actual-variable-array-paramet.patch
José Ricardo Ziviani 43ff495587 Accepting request 893847 from home:jziviani:branches:Virtualization
- Brotli VLA error was already fixed in v5.2 but the patches wasn't
  included in v6.0. This change fixes that
- Patches added:
  brotli-fix-actual-variable-array-paramet.patch
  hw-rx-rx-gdbsim-Do-not-accept-invalid-me.patch
  ui-Fix-memory-leak-in-qemu_xkeymap_mappi.patch

OBS-URL: https://build.opensuse.org/request/show/893847
OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=648
2021-05-17 21:50:55 +00:00

50 lines
2.2 KiB
Diff

From: Bruce Rogers <brogers@suse.com>
Date: Fri, 5 Mar 2021 13:25:44 -0700
Subject: brotli: fix actual variable-array parameters to match declaration
References: boo#1181922
GCC 11 complains about the mismatch between the variable-array
parameters not being defined as such in the actual function definition.
Make them match.
Signed-off-by: Bruce Rogers <brogers@suse.com>
---
c/dec/decode.c | 6 ++++--
c/enc/encode.c | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
index 114c5057d7d91f5a634167e00d84..bb6f1ab6cc42f54720fd07f665e3 100644
--- a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
+++ b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/dec/decode.c
@@ -2030,8 +2030,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
}
BrotliDecoderResult BrotliDecoderDecompress(
- size_t encoded_size, const uint8_t* encoded_buffer, size_t* decoded_size,
- uint8_t* decoded_buffer) {
+ size_t encoded_size,
+ const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
+ size_t* decoded_size,
+ uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
BrotliDecoderState s;
BrotliDecoderResult result;
size_t total_out = 0;
diff --git a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
index 68548ef55af8036d6f0fe720e721..ab0a4906060c98461102d45ab61d 100644
--- a/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
+++ b/roms/edk2/BaseTools/Source/C/BrotliCompress/brotli/c/enc/encode.c
@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
BROTLI_BOOL BrotliEncoderCompress(
int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
- const uint8_t* input_buffer, size_t* encoded_size,
- uint8_t* encoded_buffer) {
+ const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
+ size_t* encoded_size,
+ uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
BrotliEncoderState* s;
size_t out_size = *encoded_size;
const uint8_t* input_start = input_buffer;