git: 9front

Download patch

ref: e4f658567d040e25b476c69ae8434b476113499a
parent: 8154eb18d0bf134641049bddae675b48e8b6f293
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Tue Apr 23 18:47:27 EDT 2013

ftpd: fix nil pointer derefernece when ominiting arguments to opts command

--- a/sys/src/cmd/ip/ftpd.c
+++ b/sys/src/cmd/ip/ftpd.c
@@ -485,6 +485,10 @@
 {
 	char *p;
 
+	if(arg == 0 || *arg == 0){
+		reply("501 Syntax error in parameters or arguments");
+		return 0;
+	}
 	if(p = strchr(arg, ' '))
 		*p = 0;
 	if(cistrcmp(arg, "UTF-8") == 0){
--