Skip to content

Commit

Permalink
Make callback of dl_iterate_phdr return only zero or one
Browse files Browse the repository at this point in the history
(refactoring)

* dyn_load.c [!ANY_MSWIN && DYNAMIC_LOADING && (DGUX || HURD || NACL
|| SCO_ELF || (ANY_BSD || LINUX) && __ELF__) && !USE_PROC_FOR_LIBRARIES
&& HAVE_DL_ITERATE_PHDR] (GC_register_dynlib_callback): Return 1
instead of -1.
  • Loading branch information
ivmai committed Nov 5, 2024
1 parent 0da8a39 commit 3ab93b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dyn_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ GC_register_dynlib_callback(struct dl_phdr_info *info, size_t size, void *ptr)
/* Make sure struct dl_phdr_info is at least as big as we need. */
if (size
< offsetof(struct dl_phdr_info, dlpi_phnum) + sizeof(info->dlpi_phnum))
return -1;
return 1; /* stop */

p = info->dlpi_phdr;
for (i = 0; i < (int)info->dlpi_phnum; i++, p++) {
Expand Down

0 comments on commit 3ab93b5

Please sign in to comment.