Reference no: EM131112085
Fix C Code
The attached 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 are provided doesn't work as expected.
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 must use Visual Studio for C compiling.
Review and analyze the code, and determine 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.
Tip:
1. 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 your start making code changes
Submit:
Provide your fixed C source code along with a word 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. All references used should be included in your document.
Attachment:- C_Code.zip
Determine the allowed range of the diameter of copper core
: A copper-silver bimetallic wire, 1 cm in diameter, is prepared by co-extrusion with copper as the core and silver as the outer layer. The desired properties along the axis parallel to the length of the bimetallic wire are as follows: Thermal condu..
|
Process of designing goods and services
: Summarize the process of designing goods and services, and explain where the process differs between goods and services.
|
Frequently enfold the biases
: At least One page. This week's discussion thread is: How do you make valid strategic decisions given the reality that 1) data are usually of unknown reliability, 2) frequently enfold the biases and/or perspectives of the people who created them 3)..
|
Production of an online service
: The following table shows the capacity required (in thousands of unspecified units) for the production of an Online service over the next 18 months.
|
Review the given c 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.
|
New offices at atlantic management systems
: Atlantic Management System is a consulting firm that specializes in developing computerized decision support systems for computed manufacturing companies. The firm currently has offices in Chicago, Charlotte, Pittsburgh, and Houston. It is consi..
|
Calculate the value of a 5000 par value bond paying quartely
: Calculate the value of a $5,000-par-value bond paying quarterly interest at an annual coupon interest rate of 10% and having 10 years until maturity if the required return on similar-risk bonds is currently a 12% annual rate paid quarterly.
|
According to the american diabetes association
: According to the American Diabetes Association, "In 2012, 29.1 million Americans, or 9.3% of the population, had diabetes." Diabetes Mellitus can be a very debilitating disease as it can affect many organs in our body.
|
Developing an evidence-based argument
: This part of the assignment will focus on developing an evidence-based argument to support your position on a particular topic. Be sure to use additional resources to support your paper. In a 2-page paper, make an argument on one of the prompts be..
|