GIAC
GCIH · Question #605
GCIH Question #605: Real Exam Question with Answer & Explanation
Sign in or unlock GCIH to reveal the answer and full explanation for question #605. The question stem and answer options stay visible for context.
Question
You cane across the following code snippet when investigating an incident that involved a business critical system. This code crashed right after the user passed the following input to this code: '%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s'. What was the reason for the crash? #include <stdio.h> #include <conio.h> #include <string.h> #include <stdlib.h> void main() { char a[200]; scanf('%s', a); printf(a); }
Options
- AThis is a buffer overflow attack that is caused by the stack address space being pushed to printf()
- BThis is a format-string attack that could have referenced a reserved address space or the memory
- CThe crash could have been due to mismatch in the address space that is being referenced in the
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.