Review the code and perform analysis as needed

Assignment Help C/C++ Programming
Reference no: EM131559450

Assignemnt: Fixing C code with Vulnerabilities

Overview

In this homework, you will modify an existing C code application that violates several C code rules and recommendations. Your task is to locate the issues, based on the readings for this course, identify the rule(s) or recommendation(s) being violated and then fix the code. You will discuss each issue in terms of why the issue may cause a security vulnerability, and how you specifically fixed the issue.

Assignment

Review and Understand the Sample C application.

The current code, developed by a junior developer, has several issues and is not functioning as expected. The desired functionality of the program is to allow a user to select from several choices on a menu. After the user selects the "Exit" option from the menu, the program will populate a password with ‘1's and then display the value of the password. The program also captures a character so the screen can stay paused for review before exiting. Below are screen shots for a successful program execution.

Unfortunately, not only are there security issues, the code you were provided doesn't work as expected.

For the first part of this exercise demonstrate your C developer environment is working properly. You can do this by running any of the sample C code applications.

Modify the C code in this example to make the desired functionality work properly. Demonstrate the code works properly through screen captures and describing what changes were made to fix the functionality issues.

Carefully, review the code and perform analysis as needed. Consider the following rules and recommendations and hints for items that you might want to review. Note, that some rules and recommendations listed below may not be found as issues in the code.

• STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator.
• MSC24-C. Do not use deprecated or obsolescent functions.
• FIO34-C. Distinguish between characters read from a file and EOF or WEOF.
• MSC17-C. Finish every set of statements associated with a case label with a break statement.
• MSC33-C. Do not pass invalid data to the asctime() function.
• MSC17-C. Finish every set of statements associated with a case label with a break statement.
• DCL20-C. Explicitly specify void when a function accepts no arguments.
• MEM30-C. Do not access freed memory.

You can use any C compiler you have access to including:

1. Windows C++ Express or Visual Studio
2. Mac X-Code C
3. Linux gcc
4. VM player with gcc (e.g. SDEV 300 Virtual machine)

Be sure you have a C environment where you can compile. Also review those code tutorial links provided in the classroom. Post a note, or contact your professor if you are having significant difficulties compiling a C program.

Once you have your environment working, reviewed and analyzed the code, and determined the rules and recommendations that are violated, you should fix the code. Be sure to document each issue by aligning the rule or recommendation and explain exactly how you fixed the issue.

Hints:

a. Make sure your C coding environment is working first. Those C tutorials will help you to test your environment.

b. Be very careful with the pointers and memory limits of the arrays. Most modern compilers attempt to protect your system resources, but you could potentially produce access violations that could lock your system up. Take your time and review the memory bounds for all of your arrays before you start making code changes

c. Start on this early. This will take you longer than you think.

Deliverables

Provide your fixed C source code along with a PDF document describing how you addressed each issue. For example, you should list the C Cert rule or recommendation for each issue and show and describe the code that addresses the issue. You should also provide screen shots and descriptions of the successful execution of the code.

Be sure your PDF document is neat, well-organized and is well-written with minimal spelling and grammar errors. All references used should be included in your document.

Attachment:- Attachments.rar

Reference no: EM131559450

Questions Cloud

Find the median wage rate of the given workers : WAGE RATES The frequency distribution of the hourly wage rates (in dollars) among blue-collar workers in a certain factory is given in the following table.
Write a system with three equations : Write a system of two equations for the problem - Solve each system using the addition or addition-multiplication method where necessary.
How you would explain the importance of researching policies : Describe how you would explain the importance of researching policies and procedures to someone that just wants to get started on the project.
What is the final balance of the salaries expense account : What is the final balance of the "Salaries Expense" account, and is it a debit or credit? What is an audit opinion
Review the code and perform analysis as needed : Carefully, review the code and perform analysis as needed. Consider the following rules and recommendations and hints for items that you might want to review.
How much federal and state tax you need to pay : Create one Java application to calculate how much federal and state tax you need to pay. The program should accomplish the following tasks
Find the mean score the mode and the median score : EXAM SCORES In an examination given to a class of 20 students, the following test scores were obtained.
Important documents for gaining and maintaining : Acquisition strategy statements are important documents for gaining and maintaining executive support for programs and projects.
Continuum of very mature to cutting edge technology : How can the organization decide where along the continuum of very mature to cutting edge technology it belongs in its IT acquisition strategy?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd