diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
commit | 94a0819fe3a0d679c3042a77bfe6a2afc505daea (patch) | |
tree | 2b827afe6a05f3538db3f7803a88c4587fe85648 /src/test/auxiliary | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.tar.xz rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.zip |
Adding upstream version 1.66.0+dfsg1.upstream/1.66.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/auxiliary')
-rw-r--r-- | src/test/auxiliary/rust_test_helpers.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/auxiliary/rust_test_helpers.c b/src/test/auxiliary/rust_test_helpers.c index 92b7dd4b7..977ea487a 100644 --- a/src/test/auxiliary/rust_test_helpers.c +++ b/src/test/auxiliary/rust_test_helpers.c @@ -1,6 +1,7 @@ // Helper functions used only in tests #include <stdint.h> +#include <stdlib.h> #include <assert.h> #include <stdarg.h> @@ -415,3 +416,14 @@ rust_dbg_unpack_option_u64u64(struct U8TaggedEnumOptionU64U64 o, uint64_t *a, ui return 0; } } + +uint16_t issue_97463_leak_uninit_data(uint32_t a, uint32_t b, uint32_t c) { + struct bloc { uint16_t a; uint16_t b; uint16_t c; }; + struct bloc *data = malloc(sizeof(struct bloc)); + + data->a = a & 0xFFFF; + data->b = b & 0xFFFF; + data->c = c & 0xFFFF; + + return data->b; /* leak data */ +} |