Question: How can an attacker calling the C function parse_text below cause a buffer overflow? Explain how and why this works. #include #include #define BUFLEN

How can an attacker calling the C function parse_text below cause a

 

How can an attacker calling the C function parse_text below cause a buffer overflow? Explain how and why this works. #include #include #define BUFLEN 4096 int check (int n) { } if (n BUFLEN) abort ()%;B return n; void parse_text (char *text, size_t len) { } char buf [BUFLEN]; memcpy(buf, text, check (len)); /* */ [6 marks]

Step by Step Solution

3.49 Rating (156 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The parsetext function provided is vulnerable to a buffer overflow attack due to the unchecked copying of data from the text parameter into the buf ar... View full answer

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 Programming Questions!