pub fn read_stdin_with_limit() -> Result<String>Expand description
Reads from stdin with size limits to prevent memory exhaustion
§Security Checks
- Input size limit enforced (max 10MB)
- Prevents DoS via infinite stdin stream
- Returns error if input exceeds size limit
§SECURITY FIX #4
Fixed logic error: Only reject if we filled the buffer AND more data is available. Legitimate input of exactly MAX_FILE_SIZE bytes should be accepted.
§Returns
Ok(String)if input is within size limitErr(io::Error)if input exceeds limit