Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`termlens render` and `diff` read their input without any size bound

Open Beginner friendly
#653 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
84/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
cli, security

Research direction

Start in termlens-cli/src/main.rs around lines 221–230, where file and stdin input use read_to_string. Check how input is parsed and how CLI errors set exit code 2, then add bounded reading and a clear error for oversized input. Verify both reported repros refuse quickly, including the requested test using a capped child process.

Written by the indexing model from the issue text.

Description

bug good first issue

What happens. The CLI reads a whole file or stream into memory before parsing it:

( ulimit -v 300000; head -c 400000000 /dev/zero | termlens render --text - )
termlens: <stdin>: out of memory        # exit 2, after reading ~300 MB

termlens render --text /dev/zero behaves the same. Without a memory cap, yes | termlens render --text - grows until the OOM killer runs. It was not run uncapped.

Why it matters. Since #583 a saved screen is bounded: at most 1000x1000 cells, plus styles. So the input has a natural ceiling well below what the CLI will try to hold.

Cause. termlens-cli/src/main.rs:221-230 uses read_to_string on the file or stdin.

Fix. Read through .take(LIMIT + 1) with a generous limit, for example 256 MiB, and refuse with exit 2 and a clear message when it is exceeded.

Done when both repros refuse quickly with a bounded allocation, with a test using a capped child.

Dominant language
Rust
Stars
28
Forks
24
Avg merge
11h 23m
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from vyncint/termlens

All issues in vyncint/termlens

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.