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

  Write a function which takes a c string

Write a function which takes a C string as an input and counts the number of non-alphabetic characters in the C string. Non-alphabetic characters include anything outside the ranges 'a' thru 'z' and 'A' thru 'Z'.

  Program to compute the diameter in centimeters of steel rod

Input the compression load. Print the type of material, load, allowable stress, and diameter. Used formatted output with field with specifications that align output.

  Develop a program that calculates monthly payments for loan

Home Loan Amortization Develop and test a program that calculates the monthly payments for a loan amount and a term (number of years) input by the user.

  You have just upgraded your system

You have just upgraded your system to a "fast and wide" SCSI interface. This system has a floppy disk, a CD-ROM and five 8-gigabyte fixed disks. What is the device number of the host adapter? Why?

  Write a function that accepts a pointer to a string

Write a function that returns an Integer and accepts a pointer to a string as an argument. The function should count the number of characters in the string and return that number.

  Overall use-case diagram considering the scnarios

1. Draw the overall use-case diagram considering the scnarios 2. Draw the Use case brief description - with ore and post conditions

  What is taylor rule

What is Taylor rule ?  please write very short paragraph.

  Create a function that will accept a scalar value

Create a function that will accept a scalar value for the radius of the cylinder and end caps and will accept an array for the height of the cylinder.

  What''s a more efficient way to write

What's a more efficient way to write this function for a matrix? This one has to go through all the numbers, but that would take too long. r_num is row and c_num is column

  Add a non member function

For the code below add the following. Add a non member function that will run the show function of a Sport object. This object is the one parameter of the function.

  Sum of all non-inherited data members

show on the console the sum of all non-inherited data members of every instance in the program by Display() function

  Engage the many components of planning the implementation

An individual project where you will engage the many components of planning the implementation of Windows Server 2008 Active Directory. With increased use of computer technology, many medical practices, clinics and doctor's offices are moving away fr..

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