diff options
| author | Mark Wielaard <[email protected]> | 2022-10-16 18:02:46 +0200 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2022-10-16 18:02:46 +0200 |
| commit | 72860bfdca5286399837080d53ba297bf72c56b3 (patch) | |
| tree | 76fe6e7a3159d57f242a31d0c131a4d4ff5051a8 /libelf/elf_getshdrstrndx.c | |
| parent | 64ee2cb792e7b6ba6ad2a5759bff7ce8714e4668 (diff) | |
tests: Check lseek, read and malloc results with correct types in test.
When compiling dwfl-report-offline-memory.c on some systems (latest
gcc/glibc and --enable-sanitize-undefined) we might get:
In file included from /usr/include/features.h:490,
from /usr/include/assert.h:35,
from dwfl-report-offline-memory.c:18:
In function ‘read’,
inlined from ‘main’ at dwfl-report-offline-memory.c:68:23:
/usr/include/bits/unistd.h:38:10: error: ‘__read_alias’ specified size 18446744073709551615
exceeds maximum object size 9223372036854775807 [-Werror=stringop-overflow=]
38 | return __glibc_fortify (read, __nbytes, sizeof (char),
| ^~~~~~~~~~~~~~~
/usr/include/bits/unistd.h: In function ‘main’:
/usr/include/bits/unistd.h:26:16: note: in a call to function ‘__read_alias’ declared with
attribute ‘access (write_only, 2, 3)’
26 | extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
| ^~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: *** [Makefile:2461: dwfl-report-offline-memory.o] Error 1
Fix by using the correct types and checking all return values.
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'libelf/elf_getshdrstrndx.c')
0 files changed, 0 insertions, 0 deletions
