diff -uNr ftpd1.2.5-orig//ftpd.tcl ftpd1.2.5-bug3312900/ftpd.tcl
--- ftpd1.2.5-orig//ftpd.tcl	2011-06-06 22:59:33.000000000 +0000
+++ ftpd1.2.5-bug3312900/ftpd.tcl	2011-06-23 15:57:02.338732940 +0000
@@ -824,7 +824,14 @@
 	return
     }
 
-    set data(cwd) [file join $data(cwd) $relativepath]
+    set path [file join $data(cwd) $relativepath]
+
+    if {[::ftpd::Fs exists $path]} {
+        puts $sock "550 not a directory"
+        return
+    }
+
+    set data(cwd) $path
     puts $sock "250 CWD command successful."
     return
 }
