Home › Forums › C Programming › Buffer overflow c/c++ › Re: Re: Buffer overflow c/c++
July 5, 2009 at 11:31 pm
#3583
GWILouisaxwzkla
Participant
The best thing to do in c/c++ is check that the indexes are with in range :
1 2 3 4 5 | <br /> int array [ 2] [ 2 ];<br /> if ( i < 2 && j < 2 )<br /> var = array [ i ] [ j ];<br /> |
since c/c++ does not use array descriptors ( an array header with the maximum length information ) there is really no other way I can think of.