EC-Council
312-92 · Question #88
Simon is going through some of Heather's code and notices an issue. What issue did Simon find in the following code? void f4(void arg, size_t len) { char buff = new char[100]; C *ptr = new C…
The correct answer is D. Virtual pointer smashing. See the full explanation below for the reasoning.
Question
Simon is going through some of Heather's code and notices an issue. What issue did Simon find in the following code? void f4(void * arg, size_t len) { char *buff = new char[100]; C *ptr = new C; memcpy(buff, arg, len); ptr->vf(); return; }
Options
- AFunction pointer clobbering
- BNull-termination
- CData pointer modification
- DVirtual pointer smashing
How the community answered
(25 responses)- A4% (1)
- B4% (1)
- C12% (3)
- D80% (20)
Community Discussion
No community discussion yet for this question.