nerdexam
CompTIA

SY0-501 · Question #22

Refer to the following code: Which of the following vulnerabilities would occur if this is executed?

The correct answer is D. Missing null check. A 'missing null check' is a vulnerability where an application fails to validate if a reference is null before attempting to use it, which can lead to runtime errors or system instability.

Submitted by ravi_2018· Mar 4, 2026Web Security

Question

Refer to the following code:

Which of the following vulnerabilities would occur if this is executed?

Options

  • APage exception
  • BPointer dereference
  • CNullPointerException
  • DMissing null check

How the community answered

(22 responses)
  • A
    9% (2)
  • B
    14% (3)
  • C
    5% (1)
  • D
    73% (16)

Why each option

A 'missing null check' is a vulnerability where an application fails to validate if a reference is null before attempting to use it, which can lead to runtime errors or system instability.

APage exception

A page exception is a low-level operating system or hardware error related to memory access violations, which is distinct from a programmatic missing null check at the application logic level.

BPointer dereference

While a missing null check can result in an invalid pointer dereference, the vulnerability itself is the absence of the validation check rather than the act of dereferencing.

CNullPointerException

A NullPointerException is an outcome or symptom that occurs at runtime when a null reference is improperly accessed, which is typically a direct consequence of a missing null check, not the vulnerability itself.

DMissing null checkCorrect

A "missing null check" is a direct vulnerability because it represents a programming flaw where code attempts to interact with an object reference that might be null without first verifying its state. This oversight can lead to a program attempting to dereference a null pointer, causing runtime exceptions like NullPointerException.

Concept tested: Null reference handling vulnerability

Source: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/exceptions/nullreferenceexception

Topics

#null pointer#missing null check#code vulnerability#secure coding

Community Discussion

No community discussion yet for this question.

Full SY0-501 Practice