Commit 037568d
committed
host tests: Fix test that accessed unspecified memory
Depending on compiler optimization and version
ble_att_svr_test_read_mult() could rise error:
In function ‘memcpy’,
inlined from ‘TEST_CASE_ble_att_svr_test_read_mult’ at repos/apache-mynewt-nimble/nimble/host/test/src/ble_att_svr_test.c:1027:5:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:29:10: error: ‘__builtin_memcpy’ forming offset [18, 19] is out of the bounds [0, 18] of object ‘({anonymous})’ with type ‘uint8_t[18]’ {aka ‘unsigned char[18]’} [-Werror=array-bounds=]
29 | return __builtin___memcpy_chk (__dest, __src, __len,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
30 | __glibc_objsize0 (__dest));
array was clearly to short for memcpy and later data with 20
bytes had 2 unspecified values at the end
Signed-off-by: Jerzy Kasenberg <[email protected]>1 parent 5d07ffe commit 037568d
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1026 | 1026 | | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | | - | |
| 1029 | + | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
| |||
0 commit comments