Fix potential buffer overflow

Add `length` argument to `client_recv`, use `strlcpy` instead of `strcpy`.