Home Forums C Programming Buffer overflow c/c++ Re: Re: Buffer overflow c/c++

#3583
GWILouisaxwzkla
Participant

The best thing to do in c/c++ is check that the indexes are with in range :


int array [ 2] [ 2 ];
if ( i < 2 && j < 2 )
var = array [ i ] [ j ];

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.