Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン 初心者向け
#653 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
84/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
rust
領域
cli, security

調査の方向性

ファイル入力とstdin入力でread_to_stringを使っているtermlens-cli/src/main.rsの221〜230行あたりから始めてください。入力の解析方法と、CLIエラーが終了コード2を設定する方法を確認し、そのうえで読み取りに上限を設け、入力が大きすぎる場合に明確なエラーを返すようにしてください。報告された両方の再現ケースがすぐに拒否されることを確認してください。上限を設けた子プロセスを使うよう求められたテストも含みます。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Rust
スター
28
フォーク
24
平均マージ
11時間 23分
マージ済み PR(30日)
42

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vyncint/termlens のほかの issue

vyncint/termlens の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。