GIAC
GISP · Question #259
John works as a C programmer. He develops the following C program: #include <stdlib.h> #include <stdio.h> #include <string.h> int buffer(char str) { char buffer1[10]; strcpy(buffer1, str); return 1…
The correct answer is C. Buffer overflow. See the full explanation below for the reasoning.
Question
John works as a C programmer. He develops the following C program: #include <stdlib.h> #include <stdio.h> #include <string.h> int buffer(char* str) { char buffer1[10]; strcpy(buffer1, str); return 1; } int main(int argc, char *argv[]) { buffer (argv[1]); printf ("Executed\n"); return 1; } His program is vulnerable to a ________ attack.
Options
- ADenial-of-Service
- BSQL injection
- CBuffer overflow
- DCross site scripting
How the community answered
(24 responses)- A4% (1)
- B8% (2)
- C83% (20)
- D4% (1)
Community Discussion
No community discussion yet for this question.