nerdexam
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)
  • A
    4% (1)
  • B
    8% (2)
  • C
    83% (20)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full GISP Practice