ping: prevent NULL pointer dereference on write to msg_name