Fixes #6086 - stop remote command execution and path exploit in TFTP API (CVE-2014-0007)

(cherry picked from commit 854ab5573df152fd20b2be5547a08b4862fb78fe)