Ticket #10444

マクロの文字列変数に長い文字列の代入で落ちる
Date d'ouverture: 2007-05-26 01:46 Dernière mise à jour: 2007-06-11 21:50

Rapporteur:
(del#1144)
Propriétaire:
(del#1144)
Type:
État:
Atteints
Composant:
(Aucun)
Jalon:
(Aucun)
Priorité:
4
Sévérité:
5 - moyen
Résolution:
Fixed
Fichier:
2
Vote
Score: 0
No votes
0.0% (0/0)
0.0% (0/0)

Détails

#10405 が Closed にされたので、単独で起票します。

Ticket History (3/7 Histories)

2007-05-26 01:46 Updated by: (del#1144)
  • File 1882: a.ttl is attached
2007-05-30 10:49 Updated by: (del#24082)
  • Résolution Update from Aucun to Later
  • Propriétaire Update from (Aucun) to maya
  • Priorité Update from 5 - moyen to 4
Commentaire
Logged In: YES
user_id=24082

ファイルから1つの行を抽出するときに、BOFを考慮していないのが
原因のようです。改行コードが出てくるまでに、256文字以上ある
と落ちます。

LineBuff[]は256バイトのchar配列です。

とりあえず、「iが256未満」の場合のみ書き込むようにすれば、落
ちるのはなくなると思います。

GetRawLine()#ttmbuff.c

while ((BuffPtr[INest]<BuffLen[INest]) &&
((b>=0x20) || (b==0x09)))
{
LineBuff[i] = b; ★
i++;
BuffPtr[INest]++;
if (BuffPtr[INest]<BuffLen[INest])
b = (Buff[INest])[BuffPtr[INest]];
}
2007-06-09 00:30 Updated by: (del#1144)
Commentaire
Logged In: YES
user_id=1144

ここはマクロファイルを読み込んでいる部分ですよね。
この対応(malloc しない)で fix とするなら、
- 一行の最大文字数を TTL の制限事項として chm に記載した方が
よいと思います。
- ここからは「syntax error」のようなエラーを返せないでしょう
か。
2007-06-09 01:14 Updated by: (del#24082)
Commentaire
Logged In: YES
user_id=24082

最大文字数はマクロ言語 "Tera Term Language (TTL)"のデータ型
で、すでに記載があります。

syntax errorは返せるようにしたいところです。

2007-06-09 01:28 Updated by: (del#1144)
Commentaire
Logged In: YES
user_id=1144

文字列型変数の最大数は記載がありますが、
この変更(というか同じバッファサイズ)で制限されるのは
マクロコードの最大桁数ではないかと思います。
2007-06-09 01:29 Updated by: (del#1144)
  • File 1947: str.ttl is attached
2007-06-11 21:50 Updated by: (del#1144)
  • État Update from Ouvert to Atteints
  • Ticket Close date is changed to 2007-06-11 21:50
  • Résolution Update from Later to Fixed

Attachment File List

Modifier

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Connexion