exam questions

Exam 312-50v11 All Questions

View all questions & answers for the 312-50v11 exam

Exam 312-50v11 topic 1 question 41 discussion

Actual exam question from ECCouncil's 312-50v11
Question #: 41
Topic #: 1
[All 312-50v11 Questions]

Which of the following programming languages is most susceptible to buffer overflow attacks, due to its lack of a built-in bounds checking mechanism?
Code:

  • A. C#
  • B. Python
  • C. Java
  • D. C++
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
insaniunt
10 months, 1 week ago
Selected Answer: D
C and C++ are two languages that are highly susceptible to buffer overflow attacks, as they don't have built-in safeguards against overwriting or accessing data in their memory.
upvoted 1 times
...
ostorgaf
1 year, 2 months ago
Selected Answer: D
Buffer overflow attacks occur when a program writes more data to a buffer (such as an array) than it can hold. In the provided code snippet, the strcpy function is used to copy a longer string into a buffer that is only 8 bytes long. This leads to a buffer overflow, potentially causing memory corruption and program crashes. C++ lacks a built-in bounds checking mechanism, making it susceptible to buffer overflow attacks when developers are not careful about validating the length of data being copied into buffers. Other languages like C# (option A), Python (option B), and Java (option C) have safer memory management mechanisms that help prevent buffer overflow vulnerabilities.
upvoted 3 times
...
rickcoyw
1 year, 4 months ago
Selected Answer: A
The programming language in the provided code is C. C is indeed one of the programming languages that is highly susceptible to buffer overflow attacks due to its lack of built-in bounds-checking mechanisms. In the given code snippet, the use of the strcpy function is vulnerable to a buffer overflow. The strcpy function does not perform any bounds checking on the size of the destination buffer, allowing the possibility of copying more data than the buffer can hold. This can result in overwriting adjacent memory locations, leading to unexpected behavior, crashes, or security vulnerabilities.
upvoted 1 times
...
ceh007
1 year, 8 months ago
This program is written in C and not C++. The bug in the given C program is a buffer overflow. Specifically, the program attempts to copy a string of 28 characters into an array of only 8 characters using the strcpy function. This results in the buffer being overflowed and adjacent memory locations beyond the end of the buffer being overwritten. The program is written in the C programming language. This can be seen from the #include directive at the beginning of the program, which is a standard way to include header files in C programs. Additionally, the function main is a required function in C programs, and the syntax used for declaring variables and calling functions in the program is consistent with C syntax.
upvoted 4 times
...
Daniel8660
2 years ago
Selected Answer: D
In C++ run time checking is not part of the language
upvoted 2 times
...
jartavia05
2 years ago
#include <library> is a basic definition of C++. In addition, there is many documentation of best practices to avoid buffer overflow on C++. https://snyk.io/blog/buffer-overflow-attacks-in-c/
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago