Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions