[BUG] DVB: map-table cases in dvbsub_parse_pixel_data_block read past the object field data
Maintainer thường phản hồi trong vòng 1 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
- 30/100
Hướng nghiên cứu
Start in dvbsub_parse_pixel_data_block() in src/lib_ccx/dvb_subtitle_decoder.c; read the location check at the top of the loop and the string helpers that stop at buf_size, since the map cases should mirror them. For cases 0x20, 0x21 and 0x22, compare buf_end - buf against the 2, 4 or 16 operand bytes needed and set parseerror and break when short. Done looks like a truncated block ending on one of those command bytes no longer reads past buf_end. Note the reporter states a patch and PR are already planned.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
dvbsub_parse_pixel_data_block() in src/lib_ccx/dvb_subtitle_decoder.c loops
while (!parseerror && buf < buf_end), but three of its cases read a fixed
number of operand bytes from the stream without checking any remain. The loop
condition only guarantees one byte (the command byte) before each iteration.
Where
switch (*buf++)
{
...
case 0x20: // 2-bit / 4-bit map
map2to4[0] = (*buf) >> 4;
map2to4[1] = (*buf++) & 0xf; // reads 2 bytes
map2to4[2] = (*buf) >> 4;
map2to4[3] = (*buf++) & 0xf;
break;
case 0x21: // 2-bit / 8-bit map
for (i = 0; i < 4; i++)
map2to8[i] = *buf++; // reads 4 bytes
break;
case 0x22: // 4-bit / 8-bit map
for (i = 0; i < 16; i++)
map4to8[i] = *buf++; // reads 16 bytes
break;
A pixel-data sub-block whose last byte is 0x20, 0x21 or 0x22 makes the
decoder read 2, 4 or up to 16 bytes past the object's field data (buf_end is
the end of top_field_len / bottom_field_len, validated in
dvbsub_parse_object_segment).
Impact
The object's field data is a slice of the larger segment/PES buffer, so these
reads land on the adjacent bytes of that buffer rather than past the allocation
— the same reason ASan does not flag it. It is still a read past the length the
block was given, in the same class as the other bounds this function already
enforces (it checks the object location before each 0x1x pixel string, and the
string helpers stop at buf_size). The map-table cases were simply missed.
Fix
Check buf_end - buf before each of the three cases and set parseerror /
break on a short block, exactly as the location check at the top of the loop
already does.
I have a patch and will open a PR referencing this issue. Found while reading
the segment parsers after the ISDB and EPG descriptor bounds fixes.
(Analysis and patch prepared with AI assistance.)
- Ngôn ngữ chính
- C
- Star
- 919
- Fork
- 604
- Merge trung bình
- 9 ngày 5 giờ
- Pull request đã merge (30 ngày)
- 26
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
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 CCExtractor/ccextractor
-
GXF: heap buffer overflow in parse_ad_cdp() — unbounded cc_count in CDP cc data sectionCó thể đã có người làm @pranayr710 đã 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
CCExtractor/ccextractor#2498 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] + file-sequence expansion picks the digit in the extension (clip001.mp4+ only processes clip001.mp4)Có thể đã có người làm @imfarhan0105-bits đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
CCExtractor/ccextractor#2478 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] encoders: WebVTT encoder generates invalid ## delimiter and malformed @import violating W3C specificationCó thể đã có người làm @yasar710 đã nhận 7 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
CCExtractor/ccextractor#2465 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GXF: heap buffer overflow in parse_mpeg_packet() — oversized mpeg_pic_size overflows the demuxer bufferCó thể đã có người làm @pranayr710 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
CCExtractor/ccextractor#2500 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] read_exp_golomb_unsigned panics/aborts on 64 or more leading zero bits (malformed SPS)Có thể đã có người làm @Souravrajvi0 đã nhận 6 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 76/100
CCExtractor/ccextractor#2470 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CCExtractor/ccextractor
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
[TUTORIAL] Docs for Follow ModeĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area: services kind: bug preview-effort: small priority: low
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Static Analysis failureCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100