asan: mmo: NULL dereferenc in mmo_xore_32
authorAlan Modra <amodra@gmail.com>
Thu, 28 Oct 2021 02:46:04 +0000 (13:16 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 28 Oct 2021 02:55:57 +0000 (13:25 +1030)
commit0a0ff9d931ea7b2f0bc3c7c9ef6029f3d08e5a90
treedea3af14c54f3e21c2087cbdf27335f2aaab5157
parent42eec46f230cb05873fdc7561057a6ae63d17ce4
asan: mmo: NULL dereferenc in mmo_xore_32

mmo_get_loc can return NULL.  It's commented even, and that the caller
then must handle a split field.  mmo_xore_* don't handle split fields,
instead just segfault.  Stop that happening, and refuse to recognise
fuzzed mmo files that trigger this problem.

* mmo.c (mmo_get_loc): Don't declare inline.
(mmo_xore_64, mmo_xore_32, mmo_xore_16): Remove forward decls.
Return pointer, don't dereference NULL.
(mmo_scan): Return error on mmo_get_loc returning NULL.
bfd/mmo.c