In get_to_uid() throw an error when username is empty. Judging by the fact that the get_to_uid() is trying to do zero-byte copy and underlying consumers doing other nasty things such as trying to allocate 0-byte memory buffer nobody expects this condition to happen.
Sponsored by: Sippy Software, Inc. Debugging: mpatrol