Re: [patch] nto target: fix null pointer dereference

Daniel Jacobowitz
2008-08-12T21:32:59Z

On Tue, Aug 12, 2008 at 05:25:40PM -0400, Aleksandar Ristovski wrote:
> in procfs_create_inferior we call solib_create_inferior_hook, which will end up trying to determine loader base by reading inferior's memory at DT_DEBUG pointer. In our case, before the executable actually started executing, it will successfully read 0s, because dynamic loader has not been invoked yet, and the pointer to r_debug structure is not initialized.

It should already detect that zero is invalid, since that's the same
value used initially; see e.g. calls to locate_base. Where's the read
come from?

--
Daniel Jacobowitz
CodeSourcery