summaryrefslogtreecommitdiff
path: root/netkit-ftp-0.17-chkmalloc.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-08-05 02:00:14 +0000
committerCoprDistGit <infra@openeuler.org>2024-08-05 02:00:14 +0000
commit361fec5b672ef8fdb44f61fb12b2cbb2f950b347 (patch)
tree9de49e1f2fc574f4e68e0c5eb903cb537c8c2695 /netkit-ftp-0.17-chkmalloc.patch
parent75ec6de8f8f0b5d1c1905cb24264099d45eea096 (diff)
automatic import of ftpopeneuler24.03_LTS
Diffstat (limited to 'netkit-ftp-0.17-chkmalloc.patch')
-rw-r--r--netkit-ftp-0.17-chkmalloc.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/netkit-ftp-0.17-chkmalloc.patch b/netkit-ftp-0.17-chkmalloc.patch
new file mode 100644
index 0000000..f9a1210
--- /dev/null
+++ b/netkit-ftp-0.17-chkmalloc.patch
@@ -0,0 +1,33 @@
+diff -up netkit-ftp-0.17/ftp/ruserpass.c.chkmalloc netkit-ftp-0.17/ftp/ruserpass.c
+--- netkit-ftp-0.17/ftp/ruserpass.c.chkmalloc 2008-12-01 11:54:15.000000000 +0100
++++ netkit-ftp-0.17/ftp/ruserpass.c 2008-12-01 11:56:06.000000000 +0100
+@@ -137,7 +137,8 @@ next:
+ if (token()) {
+ if (*aname == 0) {
+ *aname = malloc((unsigned) strlen(tokval) + 1);
+- (void) strcpy(*aname, tokval);
++ if (*aname != NULL)
++ (void) strcpy(*aname, tokval);
+ } else {
+ if (strcmp(*aname, tokval))
+ goto next;
+@@ -158,7 +159,8 @@ next:
+ }
+ if (token() && *apass == 0) {
+ *apass = malloc((unsigned) strlen(tokval) + 1);
+- (void) strcpy(*apass, tokval);
++ if (*apass != NULL)
++ (void) strcpy(*apass, tokval);
+ }
+ break;
+ case ACCOUNT:
+@@ -170,7 +172,8 @@ next:
+ }
+ if (token() && *aacct == 0) {
+ *aacct = malloc((unsigned) strlen(tokval) + 1);
+- (void) strcpy(*aacct, tokval);
++ if (*aacct != NULL)
++ (void) strcpy(*aacct, tokval);
+ }
+ break;
+ case MACDEF: