Question: DO NOT COPY FROM CHEGG !!! PLEASE READ EVERYTHING WELL 7 (10 points) The following code tries to impose a download limit for the Simple

DO NOT COPY FROM CHEGG !!! PLEASE READ EVERYTHING WELL

7 (10 points) The following code tries to impose a download limit for the Simple Web Server. However, this code has a fatal vulnerability that can be exploited by an attacker to cause the Denial-of-service. Please explain the reason.

char sentBytes = 0; static final int MAX_DOWNLOAD_LIMIT = 5000000; // maximum allowed download size is 5MB while ((c != -1) && (sentBytes < MAX_DOWNLOAD_LIMIT)) { osw.write (c); sentBytes++;

c = fr.read();

}

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!