Regexp generated from unescaped input in #expand_class
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
The unescaped input is interpolated into a regexp in #expand_class in lib/rdoc/ri/driver.rb, near line 972, and #expand_name (around line 998) calls it. Other regexps in that file escape their input, so compare with those. Pull request #1846 is already open against this issue, so review it before starting. Done means $\ no longer triggers the 'has ']' without escape' warning in tab completion, and the input is escaped the same way as elsewhere in driver.rb.
索引モデルが issue の本文から書いたものです。
説明
It happens here:
For example, when typing $ into IRB and then hitting tab to go through the autocomplete suggestions, this prints the following warning once $\ is reached.
rdoc/ri/driver.rb:972: warning: regular expression has ']' without escape: /\A$\[^:]*\z/
Backtrace:
rdoc-8.1.0/lib/rdoc/ri/driver.rb:998:in 'RDoc::RI::Driver#expand_name'
irb-1.18.0/lib/irb/input-method.rb:410:in 'IRB::RelineInputMethod#rdoc_dialog_contents'
irb-1.18.0/lib/irb/input-method.rb:378:in 'block in IRB::RelineInputMethod#show_doc_dialog_proc'
This happens because $\ is embedded unescaped into the regexp, generating /\A$\[...].../.
Perhaps a crafty actor could even inject a Regexp that times out or raises a RegexpError.
All other regexps generated in driver.rb use escaped input, so I assume it is just an oversight in this case.
- 主要言語
- Ruby
- スター
- 927
- フォーク
- 467
- 平均マージ
- 23時間 47分
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ruby/rdoc のほかの issue
-
RDoc 8.0.0 gem omits `doc/rdoc/example.rb`, which is referenced by the packaged markup documentation対応中かも @OskarEichler が 42 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Wrong heading levels in generated HTML?対応中かも @st0012 が 7 日前に担当しました。 オープンbug
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
scanaislop/aislop#476 ·
メンテナーはふだん 1 日以内に返信
-
Dependencies view: `getParent` loops forever on untitled documents, extension host runs out of memory対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
area/web interface
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
mastodon/mastodon#41000 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
zerocracy/judges-action#2743 ·
メンテナーはふだん 8 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
endoflife-date/endoflife.date#11314 ·
メンテナーはふだん 1 日以内に返信