client: buffer overflow fix