client: fix invalid data access through invalid content-length values