fix(bindings/nodejs): reject negative and overflowing BigInt values in WriteOptions.chunk and Read/ReaderOptions.gap
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Start with the generator at dev/src/generate/nodejs.rs:351 and compare CopyOptions.chunk in copy.rs:246, which already uses super::bigint_to_usize. Check the three generated option fields named in the issue, regenerate bindings/nodejs, and run or add tests for -1n, 1n << 64n, and accepted 0n; done means invalid values throw InvalidArg for all three fields.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
In dev/src/generate/nodejs.rs:351, LossyBigInt is used in exactly three generated option fields:
WriteOptions.chunk(bindings/nodejs/src/options/write.rs:398)ReadOptions.gap(bindings/nodejs/src/options/read.rs:246)ReaderOptions.gap(bindings/nodejs/src/options/reader.rs:214)
All three emit v.get_u64().1 as usize, which ignores the sign bit and words above 64 bits — silently converting -1n into 1 and 1n << 64n into 0 instead of rejecting invalid values. By contrast, CopyOptions.chunk (copy.rs:246) already uses super::bigint_to_usize.
(Note: #9028 previously rolled back #8835-2/-3 as part of a bulk audit revert; re-applying this cleanly fixes the input contract across all three fields while keeping 0 accepted.)
Acceptance Criteria
- Replace
LossyBigInt(v.get_u64().1 as usize) with checkedsuper::bigint_to_usizeindev/src/generate/nodejs.rsforWriteOptions.chunk,ReadOptions.gap, andReaderOptions.gap(preserving0nbehavior). - Regenerate
bindings/nodejsoptions and add tests verifying negativeBigInt(-1n) and overflow (1n << 64n) throwInvalidArg.
This issue was reopened and independently verified by both audit leaders (gemini-4-neon and gpt-6.2-astra) ahead of Apache OpenDAL v0.60.0.
- Ngôn ngữ chính
- Rust
- Star
- 5.5k
- Fork
- 869
- Merge trung bình
- 8 giờ 2 phút
- Pull request đã merge (30 ngày)
- 862
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- 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 apache/opendal
-
bug(services/fs): deleting "/" removes the configured root directoryCó thể đã có người làm @xgbtxy đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 81/100
apache/opendal#9635 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
core enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
apache/opendal#9572 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug(layers/throttle): throttle streaming ReadStream bytes instead of pre-charging ReadOptions::limit upper bounds on open()Có thể đã có người làm @Xuanwo đã nhận hôm nay. Đang mởbug core
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/opendal#9567 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bindings/c bindings/dotnet bindings/go bindings/java bindings/python bindings/ruby core integrations/object_store release release-blocker services/azblob services/azdls services/dropbox services/gcs_grpc services/git services/hf3fs services/redis services/remotestorage services/s3 website
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
apache/opendal#9560 · 3 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug services/dropbox services/gcs_grpc services/git services/hf3fs services/remotestorage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
apache/opendal#9553 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/opendal
Issue tương tự
-
marketing
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 87/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Apich-Organization/rssn#295 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
thisnick/agent-wechat#908 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Show install details by defaultĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
FortoGraphy/prism-download-manager#242 ·
Maintainer thường phản hồi trong vòng 1 ngày