Abstract reader/writer issue with non-contigous input data
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- embedded-iot
調査の方向性
まず、CborParserOperations とその transfer_string 関数を cbor_value_copy_text_string まで追跡し、次に 2 つの CborValue オブジェクトに対して cbor_value_advance と cbor_value_get_type がどのように動作するかを比較します。提示された非連続イテレータの例を再現し、できれば最小ケースまで縮小します。元の値と出力先の次の値が説明どおりに進み、CborErrorIllegalType が発生しなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
So I think this may be related to and/or covered by #208 , but I wanted to open an issue to report the specifics of what i am seeing.
I think the root of the issue is that in the structure CborParserOperations the function pointer transfer_string should advance the cursor but when calling CborError cbor_value_copy_text_string(const CborValue *value, char *buffer, size_t *buflen, CborValue *next) the cursor should be advanced for the output parameter next but not advanced in the in-out parameter value. I think the user data token* is shared between copies of CborValue.
I am working in an embedded system and transitioning some existing code to use a struct netbuff like structure instead of just copying around worst-case sized buffers. To do this i need to move all my code to work on iterators instead of just taking a std::span<uint8_t> (we are on C++20). The iterators to this new structure are bidirectional_iterator, so no random access.
A simple (exposition only) example of the code that fails:
detail::ParserState<InItr, S> cbor_parse;
CborValue it;
cbor_parse.init(data.begin(), data.end(), it);
CborValue it2;
char func_name_buff[10]{};
size_t name_len = 10;
if (!cbor_value_is_text_string(&it)) {
return BadValue;
}
if (auto err = cbor_value_copy_text_string(&it, func_name_buff, &name_len, &it2) != CborNoError) {
return err;
}
auto errr = cbor_value_advance(&it); // ERROR: CborErrorIllegalType
auto type = cbor_value_get_type(&it) // CborTextStringType, should be NullType after the advance
auto type2 = cbor_value_get_type(&it2) // CborNullType
I will work on getting a minimal reproducible example into compiler explorer, especially if this is a new case.
- 主要言語
- C
- スター
- 641
- フォーク
- 222
- 平均マージ
- 21時間 33分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
intel/tinycbor のほかの issue
-
CborValidateTagUse rejects valid tag 1 (epoch) with a floating-point value, and restricts tags 21-23 too much対応中かも @thiagomacieira が 15 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
Fixing CI/CDオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 25/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
kubernetes-sigs/security-profiles-operator#3597 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
AFLplusplus/AFLplusplus#2903 ·
-
Clean up stale and inaccurate comments in the platform screen and input files対応中かも @RichStephens が今日担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 88/100
FujiNetWIFI/fujinet-config#289 ·
メンテナーはふだん 1 日以内に返信
-
category:port-update
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
nasa/cFS-GroundSystem#272 ·