Blame SOURCES/netkit-ftp-0.17-chkmalloc.patch

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