- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Would you please show a small but complete program that demonstrates this message? I'm unable to reproduce it based on your description.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's a bug - I will report it.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page