Core/Misc: Fix crash in ticket creation

Fix a crash happening with malicious CMSG_GMTICKET_CREATE packets.
Fix warnings from -Wformat.
Merge remote-tracking branch 'upstream/master'