void heap_attack(void)
{
char *b = malloc(1);
- while(memcmp(--b, "s4109503", 8) != 0);
- b += 8;
- while(memcmp(b, "s4202015", 8) != 0)
+ while(memcmp(--b, "4109503", 8) != 0);
+ b += 7;
+ while(memcmp(b, "4202015", 8) != 0)
*b++ = ' ';
}
char *s2 = malloc(8);
if(s2 == NULL)
return -1;
- strcpy(s1, "s4109503");
- strcpy(s2, "s4202015");
+ strcpy(s1, "4109503");
+ strcpy(s2, "4202015");
heap_attack();
printf("student 1: \"%s\"\n", s1);
printf("student 2: \"%s\"\n", s2);