nerdexam
CompTIA

SY0-501 · Question #193

An analyst is reviewing a simple program for potential security vulnerabilities before being deployed to a Windows server. Given the following code: Which of the following vulnerabilities is present?

The correct answer is B. Buffer overflow. The vulnerability present is a buffer overflow, which occurs when a program attempts to write more data into a fixed-size buffer than it was allocated, overwriting adjacent memory.

Submitted by jaden.t· Mar 4, 2026Threats, vulnerabilities, and mitigations

Question

An analyst is reviewing a simple program for potential security vulnerabilities before being deployed to a Windows server. Given the following code:

Which of the following vulnerabilities is present?

Exhibit

SY0-501 question #193 exhibit

Options

  • ABad memory pointer
  • BBuffer overflow
  • CInteger overflow
  • DBackdoor

How the community answered

(28 responses)
  • A
    4% (1)
  • B
    79% (22)
  • C
    7% (2)
  • D
    11% (3)

Why each option

The vulnerability present is a buffer overflow, which occurs when a program attempts to write more data into a fixed-size buffer than it was allocated, overwriting adjacent memory.

ABad memory pointer

A bad memory pointer, while also a memory-related issue, typically refers to dereferencing an invalid or uninitialized pointer, leading to a crash or corruption, rather than specifically overflowing a designated buffer's boundaries.

BBuffer overflowCorrect

A buffer overflow typically occurs when a program attempts to store data beyond the allocated size of a fixed-length buffer, such as using unsafe functions like `strcpy` or `sprintf` without proper bounds checking. This can overwrite adjacent memory locations, leading to program crashes, unpredictable behavior, or arbitrary code execution by an attacker.

CInteger overflow

An integer overflow occurs when an arithmetic operation produces a result larger than the maximum value that the data type can store, which is a distinct issue from writing data beyond the physical boundaries of a memory buffer.

DBackdoor

A backdoor is an intentional, hidden method inserted into software to bypass security controls for unauthorized access, whereas a buffer overflow is generally an unintentional programming error that can be exploited.

Concept tested: Identifying buffer overflow vulnerabilities

Source: https://learn.microsoft.com/en-us/windows/win32/secbp/buffer-overruns

Topics

#buffer overflow#secure coding#application vulnerability#memory management

Community Discussion

No community discussion yet for this question.

Full SY0-501 Practice