Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/22/09 12:31
Read: times


 
#162638 - Bounds checking
Responding to: ???'s previous message
You have a variable defined:
a_type my_var[5][5];
Then you iterate:
for (i = 0; i < 6; i++) {
    for (j = 0; j < 6; j++) {
    }
}
Now a question: If your array has valid index values [0, 1, 2, 3, 4] (in total 5 values), what happens if you copy your array using a for loop taking the values [0, 1, 2, 3, 4, 5] (in total 6 values)?

Hint: Define memory overwrite.
Hint: Define buffer overflow.
Hint: Define index-out-of-range.

List of 35 messages in thread
TopicAuthorDate
C++ and Keil problem            01/01/70 00:00      
   be less suprised,            01/01/70 00:00      
   Keil C51 is _not_ a C++ compiler.            01/01/70 00:00      
   Very old!            01/01/70 00:00      
      Ok guys            01/01/70 00:00      
         Totally missing the point!            01/01/70 00:00      
            Now what is the problem...            01/01/70 00:00      
               Post the full build output            01/01/70 00:00      
                  the code...            01/01/70 00:00      
                     Missing the point again            01/01/70 00:00      
                     No successful output from compiler possible            01/01/70 00:00      
                        C99            01/01/70 00:00      
                           C99 in Keil            01/01/70 00:00      
                     About your Code            01/01/70 00:00      
                        Local variables within inner blocks            01/01/70 00:00      
                           Thanks for correcting me.            01/01/70 00:00      
                              Improved scope            01/01/70 00:00      
   an often missed fact is ...            01/01/70 00:00      
      Coming to harware implementation.            01/01/70 00:00      
         Consultancy fees            01/01/70 00:00      
         will help            01/01/70 00:00      
         problems of Keil with C            01/01/70 00:00      
         New Topic, New Thread            01/01/70 00:00      
   I got the error            01/01/70 00:00      
      C241 Error            01/01/70 00:00      
         RTFM            01/01/70 00:00      
            how to get rid of it?            01/01/70 00:00      
               if something is too big, you need to make it smaller            01/01/70 00:00      
                  Please have a look            01/01/70 00:00      
                     Bounds checking            01/01/70 00:00      
                        Thanks            01/01/70 00:00      
                           But did you look at your code?            01/01/70 00:00      
                              ok            01/01/70 00:00      
                              ISR Problem            01/01/70 00:00      
                                 Start a new thread!            01/01/70 00:00      

Back to Subject List