Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

GAQM Exam CPEH-001 Topic 4 Question 114 Discussion

Actual exam question for GAQM's CPEH-001 exam
Question #: 114
Topic #: 4
[All CPEH-001 Questions]

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?

Show Suggested Answer Hide Answer
Suggested Answer: A, D

Contribute your Thoughts:

Ettie
8 days ago
Definitely go with option D. Adding a separate statement to check if the buffer has reached its capacity is the most straightforward way to fix this issue.
upvoted 0 times
...

Save Cancel