All pastes #34820 Raw Edit

Something

public text v1 · immutable
#34820 ·published 2005-12-24 23:25 UTC
rendered paste body
#include <stdio.h>

void overflow_function(char *str) { 

        char buffer[18];
        /*      
         * Weird.. buffer acts as 11 long up til 15,
         * then at or above 16 acts as 32
         */
         strcpy(buffer, str); // Copy str to buffer

        }       

int main() {

        char big_string[128];
        int i;  

        for(i=0; i < 128; i++) {
                big_string[i] = 'A';
                printf("%d - Doin it\n", i);
                overflow_function(big_string);
                printf("%d - Done it\n", i);
        }       

        exit(0);
}