client: fix potential buffer overrun in server name copy