From the course: Secure Coding in C

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Fix the code

Challenge: Fix the code - C Tutorial

From the course: Secure Coding in C

Start my 1-month free trial

Challenge: Fix the code

(upbeat music) - [Instructor] For this challenge, I present you with this code, which is included with the exercise files. The code compiles, and it runs. And I'll type some text. And it works. I'm also going to go ahead to a command prompt, where I can type the contents of that file just created, and there you see the contents. It works, yet, I have placed into this code eight issues. These are items mentioned in this course that should be addressed to make the code run safe, and in a predictable manner. Your task is to find and correct the issues placed into the exercise file. Modify the code as necessary, adding or removing statements, changing things to make them more safe, and remove any undefined behaviors. Keep working with the code until you find and correct as many of the eight issues as possible. This challenge should take you about 15 minutes to complete.

Contents