Untested fix for the command injection vulnerability.

Hi,
I didn't test this fix, but it should mitigate the command injection vulnerability I sent you guys.  Please review? and let me know if it looks correct? thanks!