diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2023-08-24 17:45:35 +0100 |
|---|---|---|
| committer | Thomas Huth <thuth@redhat.com> | 2023-08-31 19:10:01 +0200 |
| commit | b2a7d8633ff31ea97e7d4edc23af461a28a66d9d (patch) | |
| tree | b8d70fb6b23f1c5230be72b33bf6d17d688a373a /util/main-loop.c | |
| parent | 0a1e462daf03bf0c8119e4369807d0d4a965fbc6 (diff) | |
| download | focaccia-qemu-b2a7d8633ff31ea97e7d4edc23af461a28a66d9d.tar.gz focaccia-qemu-b2a7d8633ff31ea97e7d4edc23af461a28a66d9d.zip | |
tests/qtest/netdev-socket: Avoid variable-length array in inet_get_free_port_multiple()
We use a variable-length array in inet_get_free_port_multiple(). This is only test code called at the start of a test, so switch to a heap allocation instead. The codebase has very few VLAs, and if we can get rid of them all we can make the compiler error on new additions. This is a defensive measure against security bugs where an on-stack dynamic allocation isn't correctly size-checked (e.g. CVE-2021-3527). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20230824164535.2652070-1-peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'util/main-loop.c')
0 files changed, 0 insertions, 0 deletions