....
wstring wstrFirst;
INFO_t* pstInfo = NULL;
INFO_MAP::const_iterator itrReqInfoEnd = RequestedInfoMap_i.end();
for(INFO_MAP::const_iterator itrReqInfo = RequestedInfoMap_i.begin();
itrReqInfo != itrReqInfoEnd;
++itrReqInfo)
{
wstrFirst = itrReqInfo->first;
pstInfo = itrReqInfo->second;
...
上記のコードスニペットを参照してください。 私はこれについてCODESONAR(静的解析ツール)を実行しています。stl :: mapイテレータ使用のCODESONARのバッファオーバーランコメント
(ハイライトされたコードがpstInfo = itrReqInfo->second;
意味ここでは)それは偽陽性です
This code reads past the end of the buffer pointed to by itrReqInfo->.
. itrReqInfo-> evaluates to &wstrFirst._Bx.
. The first byte read is at offset 48 from the beginning of the buffer pointed to by itrReqInfo->, whose capacity is 48 bytes.
. The offset exceeds the capacity.
. The overrun occurs in stack memory. The issue can occur if the highlighted code executes.
: 私の問題は、最後の行(pstInfo = itrReqInfo->second;
)で、CODESONARは次のエラーを示し、ということでしょうか?そうでない場合は、どうすれば修正できますか? itrReqInfo
以来
だから何が起こるでしょうか?大丈夫ですか? Valgrindはそれについて何を言いますか? – Kupto
コードは正常に動作しています。 – krishnakumartg