Question: 2 Instructions 1. Briefly explain, with examples, why C functions gets, strcmp, strcpy are not safe. Describe their safe substitutes. 2. Does Java has the
2 Instructions 1. Briefly explain, with examples, why C functions gets, strcmp, strcpy are not safe. Describe their safe substitutes. 2. Does Java has the format string vulnerability ? Briefly explain. (Please cite any source you referenced.) 3. Consider the following piece of code written in Java. public class Problem Three { public static void main(String[] args) { int x = 1073741824; int y = 2*x; System.out.println("y="+y); (a) Explain how there can be an arithmetic overflow in the above pro- gram. (b) How would you fix the above code such that there is no possibility of an arithmetic overflow
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
