Question: The program doesn t validate if the execution of realloc ( ) was successful, that is if the memory was allocated The newly resized space

The program doesnt validate if the execution of realloc() was successful, that is if the memory was allocated
The newly resized space is un-initialized. Printing uninitialized variables can result in unexpected program behavior, such as execution of arbitrary code
Because sizeof(int) is used to compute the size, and not sizeof(long), an insufficient amount of memory can be allocated leading to a buffer overflow

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!