#1282 Array index out of bounds in array.hh file
Metadata
Property | Value |
---|---|
Reported by | shailesh borkar (shaileshborkar9@gmail.com) |
Reported at | Apr 19, 2013 10:20 |
Type | Bug Report |
Version | Git (pre2.4) [autotools] |
Operating System | Linux 64bit |
Last edited by | Oliver Sander (oliver.sander@tu-dresden.de) |
Last edited at | Oct 29, 2013 09:04 |
Closed by | Oliver Sander (oliver.sander@tu-dresden.de) |
Closed at | Oct 29, 2013 09:04 |
Closed in version | Unknown |
Resolution | Won't fix |
Comment |
Description
While accessing the elements of array class in dune/common/array.hh file, in function reference operator[] (size_type i) { return a[i]; } if any element is accessed with index more than size N,it prints garbage value. We can prevent it by simply adding single condition, reference operator[] (size_type i) { assert(i<N); return a[i]; } I am attaching my patch.