fix(bindings/nodejs): reject negative and overflowing BigInt values in WriteOptions.chunk and Read/ReaderOptions.gap
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 76/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 5.5k
- フォーク
- 869
- 平均マージ
- 8時間 2分
- マージ済み PR(30日)
- 862
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/opendal のほかの issue
-
bug(services/fs): deleting "/" removes the configured root directory対応中かも @xgbtxy が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 81/100
apache/opendal#9635 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
core enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
apache/opendal#9572 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug(layers/throttle): throttle streaming ReadStream bytes instead of pre-charging ReadOptions::limit upper bounds on open()対応中かも @Xuanwo が今日担当しました。 オープンbug core
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
apache/opendal#9567 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
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
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
apache/opendal#9560 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug services/dropbox services/gcs_grpc services/git services/hf3fs services/remotestorage
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
apache/opendal#9553 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
メンテナーはふだん 1 日以内に返信
-
area/geometry good first issue help wanted kind/doc-mismatch severity/4-minor
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Apich-Organization/rssn#295 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
thisnick/agent-wechat#908 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
FortoGraphy/prism-download-manager#242 ·
メンテナーはふだん 1 日以内に返信