bfd_set_input_error
My recent change to closing archives showed some problems with the way
we stash errors for archive elements. The most obvious thing found
by oss-fuzz, is that if output archive elements are closed during
bfd_close of an archive, then we can't access the element filename
when printing the element. So change bfd_set_input_error to stash the
entire error message instead of input bfd and input error.
* bfd.c (input_bfd, input_error): Delete.
(bfd_error, _bfd_error_buf): Move.
(_bfd_clear_error_data): Move. Make static. Clear bfd_error too.
(bfd_set_input_error): Print the error use bfd_asprintf here..
(bfd_errmsg): ..not here.
(bfd_init): Update.
* opncls.c (bfd_close_all_done): Don't call _bfd_clear_error_data.
* libbfd.h: Regenerate.
3 files changed