[PATCH v3 4/6] cli: sanitize the received header before scanning for replies