mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-12-14 21:28:57 +08:00
libctf: Sanitize error types for PR 30836
Made sure there is no implicit conversion between signed and unsigned return value for functions setting the ctf_errno value. An example of the problem is that in ctf_member_next, the "offset" value is either 0L or (ctf_id_t)-1L, but it should have been 0L or -1L. The issue was discovered while building a 64 bit ld binary to be executed on the Windows platform. Example object file that demonstrates the issue is attached in the PR. libctf/ Affected functions adjusted. Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> Co-Authored-By: Yvan ROUX <yvan.roux@foss.st.com>
This commit is contained in:
@@ -741,7 +741,6 @@ extern struct ctf_archive *ctf_arc_open_internal (const char *, int *);
|
||||
extern void ctf_arc_close_internal (struct ctf_archive *);
|
||||
extern const ctf_preamble_t *ctf_arc_bufpreamble (const ctf_sect_t *);
|
||||
extern void *ctf_set_open_errno (int *, int);
|
||||
extern unsigned long ctf_set_errno (ctf_dict_t *, int);
|
||||
extern void ctf_flip_header (ctf_header_t *);
|
||||
extern int ctf_flip (ctf_dict_t *, ctf_header_t *, unsigned char *, int);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user