The problem is with the sprintf(buf, "f%s", nick); of the code getting the font for the new query window from mirc.ini - buf is 300 bytes, nick is taken directly from the server.
Temporary workaround until the new mIRC is out:
on ^*:OPEN:?:*:if ($len($nick) > 298) halt
Other, more invasive workarounds: use a dedicated query window, put queries on ignore, etc.