Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

No error return for too small buffers in XMLUtil::ToString

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

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

評価

この issue はまだ評価されていません。

説明

I did some code analysis for the XMLUtil class of the code.
There are some findings regarding the usage of ToStr functions.

The user of the ToStr methods has to make an assumption of the buffersize
in which the variable should be rendered.
If the buffersize will be too small the used snprintf will cut the
generated string to the given buffersize (good)
but will report no error if a truncation of the generated string appears (bad)

So there will be some workarounds for that case.

  1. return the result of snprintf to the user of that method (minimum)
  2. return the result with the required length of buffer to the user (somehow better)
  3. use e.g. the stream functionality of c++ to get rid of the size assumptions at all
    (with the drawback of internal memory allocations and maybe a performance drawback)

I would like to contribute one of the topics above (but only if there will be an acceptance for
these proposals)

主要言語
C++
スター
5.8k
フォーク
2k
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

leethomason/tinyxml2 のほかの issue

leethomason/tinyxml2 の issue をすべて見る

似ている issue

C++ の issue をもっと見る

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

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