Question: Q2. 20pts [Exercise 17.1] Consider the buffer overflow vulnerability in the code below: 1: char sensor_data[16]; 2: int secret_key; 3: void read sensor_data () {

 Q2. 20pts [Exercise 17.1] Consider the buffer overflow vulnerability in the

Q2. 20pts [Exercise 17.1] Consider the buffer overflow vulnerability in the code below: 1: char sensor_data[16]; 2: int secret_key; 3: void read sensor_data () { 4: int i = 0; 5: // more_date returns 1 if there is more data, and 0 otherwise 6: while (more_date()) { 7: sensor_data[i] = get_next_byte(); 8: i++; 9: } 10: return; 11: } Modify the code so as to prevent the buffer overflow, or explain in a few sentences how you can prevent the buffer overflow caused by this code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!