Scheme-less stream URLs throw NullPointerException instead of URISyntaxException
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- networking
Hướng nghiên cứu
Bắt đầu từ lớp UrlParser trong module common, tại parse, nơi kiểm tra hỗ trợ giao thức chỉ chạy khi uri.scheme khác null. Constructor sau đó gán scheme = uri.scheme, gây ra NPE. Chạy UrlParser.parse("//localhost/live/test", arrayOf("rtmp")) để tái hiện. Hoàn thành khi đầu vào không có scheme ném URISyntaxException và các test hiện có của module common vẫn chạy đạt.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Kotlin
- Star
- 3k
- Fork
- 946
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pedroSG94/RootEncoder
-
Nullable GIF input causes NullPointerException in GifStreamObject.loadCó thể đã có người làm @blihio đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
pedroSG94/RootEncoder#2216 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
pedroSG94/RootEncoder#2213 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
pedroSG94/RootEncoder#2207 · 1 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
pedroSG94/RootEncoder#2203 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
pedroSG94/RootEncoder#2192 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của pedroSG94/RootEncoder
Issue tương tự
-
bug follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
binding:web core docs p3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
RunanywhereAI/runanywhere-sdks#1123 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
StepExamBenchmarkTest runs a loop and prints a timing but asserts nothingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởjules
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
open-learning-exchange/myplanet#18199 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 4 ngày
-
getCredentials fails on an unrecognized fingerprint while the biometric prompt is still openĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
auth0/Auth0.Android#1095 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:style bug engine:native
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
maplibre/maplibre-compose#1829 ·
Maintainer thường phản hồi trong vòng 1 ngày