- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hello all,
The following error is generated by a static analysis of my application:
error #12048: buffer overflow: array index of "DESIND" is outside the bounds; array "DESIND" of size (1:5) is indexed by value 0
This error refers to the following file where DESIND is declared as:
CHARACTER*6 DESIND
and the offending line is:
DESIND ='IALFA'
Is this really a buffer overflow? If so, how so?
Thanks,
Jim
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Would you please show a small but complete program that demonstrates this message? I'm unable to reproduce it based on your description.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi Steve!
The program is very simple:
PROGRAM CONSOLE1
CHARACTER*6 DESIND
DESIND = '123456'
DESIND = '12345'
DESIND = '1234'
END PROGRAM
The command line is as follow:
/nologo /debug:full /Od /Qdiag-enable:sc2 /Qdiag-enable:sc-full /Qdiag-enable:sc-include /Qdiag-enable:sc-single-file /warn:interfaces /module:"Debug\\" /object:"Debug\\" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c
and the static analysis output (if you can find the pdr file!) contains,
Main.f90(6): error #12048: buffer overflow: array index of "DESIND" is outside the bounds; array "DESIND" of size (1:5) is indexed by value 0
I played around with it a little bit. The above seems to be the simplest case that generates the error message.
It is weird! I don't understand it at all.
Thanks!
Jim