nerdexam
EC-Council

312-49 · Question #253

Kyle is performing the final testing of an application he developed for the accounting department. His last round of testing is to ensure that the program is as secure as possible. Kyle runs the…

The correct answer is C. Buffer overflow. The code demonstrates a classic buffer overflow vulnerability. A fixed-size buffer of 10 bytes is declared, but strcpy(buffer, argv[1]) copies user-supplied input into it with no bounds checking. If the argument passed exceeds 10 characters, it will overwrite adjacent memory on…

Submitted by devops_kid· Apr 18, 2026Malware Forensics

Question

Kyle is performing the final testing of an application he developed for the accounting department. His last round of testing is to ensure that the program is as secure as possible. Kyle runs the following command. What is he testing at this point? #include #include int main(int argc, char *argv[]) { char buffer[10]; if (argc < 2) { fprintf (stderr, "USAGE: %s string\n", argv[0]); return 1; } strcpy(buffer, argv[1]); return 0; }

Options

  • ASQL injection
  • BFormat string bug
  • CBuffer overflow
  • DKernal injection

How the community answered

(52 responses)
  • B
    4% (2)
  • C
    90% (47)
  • D
    6% (3)

Explanation

The code demonstrates a classic buffer overflow vulnerability. A fixed-size buffer of 10 bytes is declared, but strcpy(buffer, argv[1]) copies user-supplied input into it with no bounds checking. If the argument passed exceeds 10 characters, it will overwrite adjacent memory on the stack, potentially allowing an attacker to hijack program execution. This is not SQL injection (no database interaction), not a format string bug (no format specifiers like %s/%x are used with user input), and not kernel injection.

Topics

#Buffer Overflow#Vulnerability Assessment#C Programming#Memory Safety

Community Discussion

No community discussion yet for this question.

Full 312-49 Practice