Which of the following pseudocodes can be used to handl…

Which of the following pseudocodes can be used to handle program exceptions?

Which of the following pseudocodes can be used to handle program exceptions?

A.
If program detects another instance of itself, then kill program instance.

B.
If user enters invalid input, then restart program.

C.
If program module crashes, then restart program module.

D.
If user’s input exceeds buffer length, then truncate the input.

Explanation:
Exception handling is an aspect of secure coding. When errors occur, the system should revert back to a secure state. This must be coded into the system by the
programmer, and should capture all errors and exceptions that could cause the application or its modules to crash. Restarting the application or module would
ensure that the application reverts back to a secure state.
Incorrect Answers:
A: Checking whether a program is running already is not a form of error or exception handling.
B, D: These are examples of input validation.

Stewart, James Michael, CompTIA Security+ Review Guide, Sybex, Indianapolis, 2014, pp 230,



Leave a Reply 0

Your email address will not be published. Required fields are marked *