Can the strtok function be used unsafely here?

オープン
#207 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
c

調査の方向性

The question concerns Cellular_ATGetSpecificNextTok in cellular_at_core.c around line 564, where strtok is called on the AT response string after a delimiter check. Read the surrounding tokenizer logic to see how the string pointer and delimiter are handled, and whether strtok's internal state can clash with other callers. Done means a clear answer on whether the call is unsafe and, if so, a proposed fix with a test in the cellular AT test suite.

索引モデルが issue の本文から書いたものです。

説明

cellular_at_core.c:564
func: Cellular_ATGetSpecificNextTok

if( atStatus == CELLULAR_AT_SUCCESS )
{
dataStrlen = ( uint16_t ) strlen( *ppString );

  if( ( **ppString ) == ( *pDelimiter ) )
  {
      **ppString = '\0';
      tok = *ppString;
  }
  else
  {
      tok = strtok( *ppString, pDelimiter );
  }

}

主要言語
C
スター
101
フォーク
73
平均マージ
28日 19時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

FreeRTOS/FreeRTOS-Cellular-Interface のほかの issue

FreeRTOS/FreeRTOS-Cellular-Interface の issue をすべて見る

似ている issue

C の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。