nerdexam
GIAC

GCIH · Question #322

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; }

Sign in or unlock GCIH to reveal the answer and full explanation for question #322. The question stem and answer options stay visible for context.

Vulnerability Exploitation & Privilege Escalation

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

  • ASQL injection
  • BDenial-of-Service
  • CBuffer overflow
  • DCross site scripting

Unlock GCIH to see the answer

You've previewed enough free GCIH questions. Unlock GCIH for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#buffer overflow#strcpy#stack smashing#memory corruption
Full GCIH Practice