Question
Problem code: This code was created for and compiled by Visual C++ 6, which lacks security protection: //Winows Task Manager displays the memory leak with
Problem code:
This code was created for and compiled by Visual C++ 6, which lacks security protection:
//Winows Task Manager displays the memory leak with each iteration
#include
void main( void )
{
char buffer[200], s[] = "computer", c = 'l';
int i = 35, j;
float fp = 1.7320534f;
/* Format and print various data: */
printf("If this line is printed more than once then the IP has been modified. ");
j = sprintf( buffer, "\tString: %s ", s );
j += sprintf( buffer + j, "\tCharacter: %c ", c );
j += sprintf( buffer + j, "\tInteger: %d ", i );
j += sprintf( buffer + j, "\tReal: %f ", fp );
j += sprintf( buffer+j, "\t%s", "############################################################################abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" );
printf( "Output: %s character count = %d ", buffer, j );
First hypothesize what will happen when this runs. What will it do?
What action might you take to ensure that the code like the one from this exercise does not make it into your production (released) game application? How might you have to react to get a fix for code like this out to your users? What do the more recent versions of Visual Studio provide you to combat security issues?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started