Tag: security

Questions Related to security

  1. This is a double free vulnerability and must be fixed

  2. The second call to free() will return an error

  3. There might be compiler warnings, but the program will run fine

  4. This is not a security issue


Correct Option: A
  1. scanf("%.8s", name);

  2. scanf("%8s", name);

  3. scanf("%8c", name);

  4. scanf("%s", name);


Correct Option: B
  1. 4 - it is the size of the pointer

  2. 5 - it is the number of characters in the string that the pointer points to

  3. 4 - it is the size when 32000 is stored as integer

  4. 1 - it is the size of a character variable


Correct Option: A