Other exams

Buffer Overflow

void next_tag(char* buf) {
strncpy(buf, "FOOBAR", 6);
}void main (int argc, char* argv[]) {
char a[8];
char b[8];
next_tag(a) ; /*copies "FOOBAR" into a */
gets(b);	/*copies from the standard input into b */
}