Buffer X in an Accounting application module for Brownies Inc. can contain 200 characters. The
programmer makes an assumption that 200 characters are more than enough. Because there
were no proper boundary checks being conducted, Bob decided to insert 400 characters into the
200-character buffer. (Overflows the buffer). Below is the code snippet:
How can you protect/fix the problem of your application as shown above?
A.
Because the counter starts with 0,we would stop when the counter is less than 200
B.
Because the counter starts with 0,we would stop when the counter is more than 200
C.
Add a separate statement to signify that if we have written less than 200 characters to the
buffer,the stack should stop because it cannot hold any more data
D.
Add a separate statement to signify that if we have written 200 characters to the buffer,the
stack should stop because it cannot hold any more data
The question has not asked to pick more than one answer choice….
Can someone clarify if it will be really like this on the exam?
Hi Nash,
I’ve tried to checked at different websites.
http://www.aiopass4sure.com/ec-council-exams/312-50-ceh-v6-exam-questions/how-can-you-protectfix-the-problem-of-your-application-as-shown-above-3.html
it does mentioned choose 2
Regards
Km
Seems that aiopass4sure is better than this shit webpage
It seems answer is D