Cast content_length to signed int for error-check comparison

Cast content_length to signed int for error-check comparison, preventing segfault when attempting to read buffer.