StackGuarded #3


/* sg3.c                                        *
 * specially crafted to feed your brain by gera */

char *read_it(char *msg) {
    char buf[128];
    int count;

    buf[read(0,buf,sizeof buf)]=0;
    return strdup(buf);
}

int main(int argv, char **argc) {
    char *msg = malloc(1000);

    snprintf(msg,1000,"User: %s",read_it(msg));
}

{Previous} {index} {Next}