Question
Write a Python program to simulate a buffer overflow, then implement input validation to prevent it. There are two parts to this assignment: 1) The
Write a Python program to simulate a buffer overflow, then implement input validation to prevent it. There are two parts to this assignment:
1) The program should display a welcome message and prompt the user for a username. Create a buffer overflow condition by allowing a user to input more data than the size of the allocated memory (causing the program to crash).
2) Implement input validation to mitigate the overflow vulnerability. Check that the username entered has a minimum length of 8 characters and a maximum of 25 characters. If the user enters a username length outside those limits, return an error message and prompt the user to re-enter the username.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started