scooter: You seem inherently confused and unhelpful to everyone. Are you ASKING us or TELLING us? Are there more constraints than your initial question stated, or are you just artificially limiting the query to things you can understand?
Your initial post says "What are the vulnerabilities associated with this code?". There are several described in the posts above.
You said "I'm stuck with what kind of attack could occur to the code posted below". That has been answered too.
Valid answers to that don't really need much to work out how they operate and also how to stop them. And I can "crash" that code and trash unknown memory by at least three ways within two seconds of looking at it, for instance:
grab_request(NULL, 0);
grab_request(fake_pointer_to_junk_that_is_near_som ething_important, -2000);
grab_request(buffer_with_20_elements, 20);
What precisely do you need from here?