Engineering C++ - Quiz
  • 1. When is buffer overflow possible to have in your C++ code?
A) When the length of some input data is not correctly checked
B) When the program generates the wrong output
C) When the program doesn’t compile
D) When the programs does not return a value
  • 2. An attacker enters a long string into the date field. The input overwrites parts of the running program and executes commands on the server. What type of attack just took place?
A) SQL Injection Attack
B) Buffer Overflow Attack
C) Cross Site Scripting Attack
D) Phishing Attack
  • 3. In a buffer overflow attack…
A) The input takes more space than allocated
B) The program generates the wrong input
C) The program doesn’t return a value
D) The program doesn’t compile
  • 4. How do you avoid a buffer Overflow?
A) Use PHP script
B) Use SQL script
C) Use functions that take a maximal length
D) Use functions that take a lesser length
  • 5. If you don’t secure your code what can happen?
A) Someone can fix your code
B) Someone can add code to your program
C) Someone can leave helpful comments
D) Someone can inject code directly into your system
  • 6. In a buffer overflow attack, the input takes _____ ______ than allocated for the variable.
A) more space
B) int and strings
C) double numbers
D) real numbers
  • 7. Which of the following is the correct operator to compare two variables?
A) equal
B) ==
C) =
D) :=
  • 8. What is an undeclared variable?
A) A variable that you didn’t declare
B) Source Code
C) A variable that ends with a semicolon
D) Programs do not return a value
  • 9. What is PC-Lint?
A) A Static Analysis Tool for C/C++
B) An IDE
C) A C/C++ Compiler
D) An Source Code Tool
  • 10. When an input is carefully crafted, it lets the attacker do what?
A) Run comments of his or her choice
B) Run commands of his or her choice
C) Run new codes of his or her choice
D) Run new choices of his or her choice
  • 11. Which is another name for buffer overflow?
A) Buffer Overkill
B) Buffer Overdraft
C) Buffer Overrun
D) Buffer Over the Top
  • 12. Buffer overflow can be triggered by what?
A) Outputs
B) Memory
C) Tags
D) Inputs
  • 13. Which is not a type of Loop?
A) If-Else
B) Do-While
C) While
D) For
  • 14. PC-Lint is for what language?
A) C#
B) .Net
C) Java
D) C++
  • 15. A Do While loop is useful for…
A) reversed
B) 1 choice
C) to loop once
D) multiple choices
  • 16. What accounts for most security breaches?
A) Virus
B) Inheritance
C) Buffer Overflow
D) SQL Injections
  • 17. To avoid buffer overflow you should avoid what?
A) spinf() and typdef()
B) vscanf() and stmcat()
C) strcpy() and strcat()
D) stmcpy() and smcatt()
  • 18. Which of these are not types of Buffer Overflow?
A) Buffer Overturn
B) Stack Overflow
C) Format String
D) Heap Overflow
  • 19. What is the only function all C++ programs must contain?
A) program()
B) start()
C) system()
D) main()
  • 20. What punctuation ends most lines of C++ code?
A) ;(semi-colon)
B) ‘(single quote)
C) :(colon)
D) .(dot)
Created with That Quiz — the site for test creation and grading in math and other subjects.