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

buffer_skip_whitespace accepts every byte below 0x21 as whitespace

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

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

評価

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

調査の方向性

cJSON_ParseWithLengthOpts 経由で到達する buffer_skip_whitespace ループから開始し、0x21 未満のバイトがどのように分類されるかを調べます。空白の処理をスペース、タブ、LF、CR に限定し、示されている制御バイト入力が拒否される一方で、有効な JSON の空白は引き続き受け入れられることを確認します。

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

説明

buffer_skip_whitespace skips any byte <= 32, so NUL, 0x01, 0x0b, 0x1f, and every other control byte are accepted as whitespace between tokens. JSON whitespace is only space, tab, LF, and CR. With cJSON_ParseWithLengthOpts the NUL case is reachable too:

cJSON_ParseWithLengthOpts("[\x0b1]", 5, NULL, 1);   /* [1] */
cJSON_ParseWithLengthOpts("[\x011]", 5, NULL, 1);   /* [1] */
cJSON_ParseWithLengthOpts("\x00null", 6, NULL, 1);  /* null */

Form feed is in the JSONTestSuite list in #877 and control characters inside strings are #871; the other bytes between tokens are not in either. Found on v1.7.19 with a property that splices one control byte at a random offset of a valid document. A fix is to accept only ' ', '\t', '\n', '\r' in that loop.

主要言語
C
スター
13k
フォーク
3.5k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

DaveGamble/cJSON のほかの issue

DaveGamble/cJSON の issue をすべて見る

似ている issue

C の issue をもっと見る

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

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