Scheme-less stream URLs throw NullPointerException instead of URISyntaxException
メンテナーはふだん 3 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- networking
調査の方向性
common モジュールの UrlParser クラス、parse から始めてください。parse では、プロトコルサポートのチェックが uri.scheme が null でない場合にのみ実行されます。その後コンストラクタが scheme = uri.scheme を代入し、そこで NPE が発生します。再現には UrlParser.parse("//localhost/live/test", arrayOf("rtmp")) を実行します。スキーマのない入力が URISyntaxException をスローし、既存の common のテストが引き続き通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
UrlParser.parse allows a scheme-less URI with a host and path to pass validation, then throws NullPointerException when assigning the null scheme to a non-null Kotlin property.
The streaming clients catch URISyntaxException around URL parsing, so this input bypasses their malformed-endpoint handling.
To reproduce
Call either of the following:
UrlParser.parse("//localhost/live/test", arrayOf("rtmp"))
UrlParser.parse("//127.0.0.1:1935/live/test", arrayOf("rtmp"))
Both produce:
java.lang.NullPointerException: getScheme(...) must not be null
The current condition only checks whether the protocol is supported when uri.scheme != null. A missing scheme skips this check, and the constructor later fails at scheme = uri.scheme.
Expected behavior
Reject a missing scheme with URISyntaxException, as with an unsupported scheme, so callers can use the existing malformed-URL handling.
Environment
- Source version: 2.8.1
- Commit: 82a9cb4ee4babdc792d2ccee8b893f2b36207d40
- Module: common
- Class: UrlParser
- Reproduced on the JVM and in Android local unit tests using JDK 17 and Gradle 9.7.1.
- A device or media server is not required to reproduce this parser failure.
Additional context
Two regression tests reproduce the issue: a scheme-less hostname URL and a scheme-less IPv4 URL with an explicit port. Both fail with NPE before the fix and pass afterward.
With only the fix and its tests applied, all 100 common and 25 encoder local unit tests pass.
A full client connection or device-level crash was not tested.
- 主要言語
- Kotlin
- スター
- 3k
- フォーク
- 946
- 平均マージ
- 5日 1時間
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pedroSG94/RootEncoder のほかの issue
-
Nullable GIF input causes NullPointerException in GifStreamObject.load対応中かも @blihio が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
pedroSG94/RootEncoder#2216 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
pedroSG94/RootEncoder#2213 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
pedroSG94/RootEncoder#2207 · リアクション 1 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
pedroSG94/RootEncoder#2203 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
pedroSG94/RootEncoder#2192 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
pedroSG94/RootEncoder の issue をすべて見る
似ている issue
-
bug follow-up
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
binding:web core docs p3
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
RunanywhereAI/runanywhere-sdks#1123 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openai/openai-java#1202 ·
メンテナーはふだん 1 日以内に返信
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothing対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンjules
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
open-learning-exchange/myplanet#18199 · コメント 1 件 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
auth0/Auth0.Android#1095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信