Search Header Logo

Computer Science - Buffer Overflows & Runtime Checks Worksheet

Authored by Sini Thomas

Computers

University

5 covered

Computer Science - Buffer Overflows & Runtime Checks Worksheet
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A program asks a user to type a 20-character username. What is the main purpose of the buffer the program reserves?

To hold the user's input in a reserved section of memory while the program processes it.
To permanently store the username on the hard drive.
To encrypt the username before it is displayed.
To block all network traffic while the user types.

Tags

5.5.D

5.5.D.1

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a buffer overflow, what usually causes the problem?

The user enters more data than the buffer was designed to hold.
The user enters data too slowly.
The buffer stores data on the CPU instead of RAM.
The program uses too many passwords.

Tags

5.5.D

5.5.D.1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A developer expects a 4-digit PIN. Which design choice best matches 5.5.D.1?

Reserve a buffer sized for the expected PIN input before accepting user data.
Reserve no memory and write each digit directly to disk.
Accept unlimited input and ignore extra characters.
Store the PIN only in the network card.

Tags

5.5.D

5.5.D.1

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement best describes a buffer in an application?

A designated section of memory reserved to temporarily store data like user input.
A password policy that limits login attempts.
A firewall rule that blocks unsafe ports.
A type of encryption key used for HTTPS.

Tags

5.5.D

5.5.D.1

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A program expects an email address, but it allocates a buffer sized for only 10 characters. What risk does this create?

A higher chance that user input exceeds the buffer and overflows it.
A guarantee that the email address will be encrypted.
A reduction in the amount of RAM the computer has.
A guarantee that the program will run faster and safer.

Tags

5.5.D

5.5.D.1

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why does the program choose the number of memory segments in a buffer?

It is based on the type and amount of input the program expects.
It is always the same number for every program.
It is chosen by the user at login.
It is determined by the network router.

Tags

5.5.D

5.5.D.1

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A text box should accept up to 200 characters. Which buffer design is safest?

Allocate a buffer that matches the expected maximum input (or safely enforces that limit).
Allocate a 10-character buffer and allow any input length.
Allocate a buffer only after the program prints the result.
Allocate no buffer and copy characters into random memory.

Tags

5.5.D

5.5.D.1

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?