Jiri Skala 09f5af
diff -up netkit-ftp-0.17/ftp/ruserpass.c.chkmalloc netkit-ftp-0.17/ftp/ruserpass.c
Jiri Skala 09f5af
--- netkit-ftp-0.17/ftp/ruserpass.c.chkmalloc	2008-12-01 11:54:15.000000000 +0100
Jiri Skala 09f5af
+++ netkit-ftp-0.17/ftp/ruserpass.c	2008-12-01 11:56:06.000000000 +0100
Jiri Skala 09f5af
@@ -137,7 +137,8 @@ next:
Jiri Skala 09f5af
 			if (token()) {
Jiri Skala 09f5af
 				if (*aname == 0) { 
Jiri Skala 09f5af
 					*aname = malloc((unsigned) strlen(tokval) + 1);
Jiri Skala 09f5af
-					(void) strcpy(*aname, tokval);
Jiri Skala 09f5af
+					if (*aname != NULL)
Jiri Skala 09f5af
+						(void) strcpy(*aname, tokval);
Jiri Skala 09f5af
 				} else {
Jiri Skala 09f5af
 					if (strcmp(*aname, tokval))
Jiri Skala 09f5af
 						goto next;
Jiri Skala 09f5af
@@ -158,7 +159,8 @@ next:
Jiri Skala 09f5af
 			}
Jiri Skala 09f5af
 			if (token() && *apass == 0) {
Jiri Skala 09f5af
 				*apass = malloc((unsigned) strlen(tokval) + 1);
Jiri Skala 09f5af
-				(void) strcpy(*apass, tokval);
Jiri Skala 09f5af
+				if (*apass != NULL)
Jiri Skala 09f5af
+					(void) strcpy(*apass, tokval);
Jiri Skala 09f5af
 			}
Jiri Skala 09f5af
 			break;
Jiri Skala 09f5af
 		case ACCOUNT:
Jiri Skala 09f5af
@@ -170,7 +172,8 @@ next:
Jiri Skala 09f5af
 			}
Jiri Skala 09f5af
 			if (token() && *aacct == 0) {
Jiri Skala 09f5af
 				*aacct = malloc((unsigned) strlen(tokval) + 1);
Jiri Skala 09f5af
-				(void) strcpy(*aacct, tokval);
Jiri Skala 09f5af
+				if (*aacct != NULL)
Jiri Skala 09f5af
+					(void) strcpy(*aacct, tokval);
Jiri Skala 09f5af
 			}
Jiri Skala 09f5af
 			break;
Jiri Skala 09f5af
 		case MACDEF: