registry: sanity check `info.dli_fname` before use
The following discussion from !1627 (merged) should be addressed:
-
@slomo started a discussion: (+1 comment) Can
info.dli_fname
beNULL
, e.g. if the shared library was deleted after the process was started? Might be best to guard against that and to returnNULL
in that case.Also the Linux manpage at least gives an annoying warning:
Sometimes, the function pointers you pass to dladdr() may surprise you. On some architectures (notably i386 and x86-64), dli_fname and dli_fbase may end up pointing back at the object from which you called dladdr(), even if the function used as an argument should come from a dynamically linked library.
On macOS this doesn't really happen and iOS doesn't use the plugin scanner. This would be relevant for supporting linux + other unices which may behave weirdly.