Home GnuPG
Diffusion GpgOL 7eed3c4c5e9f

Fix strange crash in recipient lookup


Fix strange crash in recipient lookup

* src/mail.cpp (Mail::locate_keys): Add reentrancy guard.

The strangest thing seems to happen here:
In get_recipients the lookup for "AddressEntry" on
an unresolved address might cause network traffic.

So Outlook somehow "detaches" this call and keeps
processing window messages while the call is running.

So our do_delayed_locate might trigger a second locate.
If we access the OOM in this call while we access the
same object in the blocked "detached" call we crash.

After the window message is handled outlook retunrs
in the original lookup.

A better fix here might be a non recursive lock
of the OOM. But I expect that if we lock the handling
of the Windowmessage we might deadlock.

This also might be a cause for the crashes which caused