Workshop

The quiz questions are designed to strengthen the knowledge you gain each hour.

Quiz

1: Why must you not pass unprotected user input to a shell command?
2: What is the difference between the cgiFormSelectSingle() and cgiFormRadio() functions in cgic?
3: Why is it important to make sure that you allocate enough space for strings in CGI programs written in C?

Quiz Answers

A1: Users can send shell commands to your scripts through form fields. If you pass those commands to the shell, they can cause security problems.
A2: There is no difference between the two functions.
A3: If you try to store a string in a variable that is not large enough to hold it, a buffer overflow occurs.

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.