Blame SOURCES/netkit-ftp-0.17-segv.patch
|
|
09d58c |
--- netkit-ftp-0.17/ftp/ftp.c.segv 2004-06-14 11:04:38.000000000 -0400
|
|
|
09d58c |
+++ netkit-ftp-0.17/ftp/ftp.c 2004-06-14 11:06:46.000000000 -0400
|
|
|
09d58c |
@@ -472,6 +472,8 @@
|
|
|
09d58c |
return (0);
|
|
|
09d58c |
}
|
|
|
09d58c |
lostpeer(0);
|
|
|
09d58c |
+ fclose(cout);
|
|
|
09d58c |
+ cout = NULL;
|
|
|
09d58c |
if (verbose) {
|
|
|
09d58c |
printf("421 Service not available, remote server has closed connection\n");
|
|
|
09d58c |
(void) fflush(stdout);
|
|
|
09d58c |
@@ -529,7 +531,14 @@
|
|
|
09d58c |
cpend = 0;
|
|
|
09d58c |
(void) signal(SIGINT,oldintr);
|
|
|
09d58c |
if (code == 421 || originalcode == 421)
|
|
|
09d58c |
+ {
|
|
|
09d58c |
lostpeer(0);
|
|
|
09d58c |
+ if(cout)
|
|
|
09d58c |
+ {
|
|
|
09d58c |
+ fclose(cout);
|
|
|
09d58c |
+ cout = NULL;
|
|
|
09d58c |
+ }
|
|
|
09d58c |
+ }
|
|
|
09d58c |
if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN)
|
|
|
09d58c |
(*oldintr)(SIGINT);
|
|
|
09d58c |
return (n - '0');
|
|
|
09d58c |
@@ -1790,6 +1799,11 @@
|
|
|
09d58c |
if (ptabflg)
|
|
|
09d58c |
code = -1;
|
|
|
09d58c |
lostpeer(0);
|
|
|
09d58c |
+ if(cout != NULL)
|
|
|
09d58c |
+ {
|
|
|
09d58c |
+ fclose(cout);
|
|
|
09d58c |
+ cout = NULL;
|
|
|
09d58c |
+ }
|
|
|
09d58c |
}
|
|
|
09d58c |
(void) getreply(0);
|
|
|
09d58c |
(void) getreply(0);
|
|
|
09d58c |
@@ -1815,6 +1829,11 @@
|
|
|
09d58c |
perror("reset");
|
|
|
09d58c |
code = -1;
|
|
|
09d58c |
lostpeer(0);
|
|
|
09d58c |
+ if(cout != NULL)
|
|
|
09d58c |
+ {
|
|
|
09d58c |
+ fclose(cout);
|
|
|
09d58c |
+ cout = NULL;
|
|
|
09d58c |
+ }
|
|
|
09d58c |
}
|
|
|
09d58c |
else if (nfnd) {
|
|
|
09d58c |
(void) getreply(0);
|
|
|
09d58c |
@@ -1897,6 +1916,11 @@
|
|
|
09d58c |
if (ptabflg)
|
|
|
09d58c |
code = -1;
|
|
|
09d58c |
lostpeer(0);
|
|
|
09d58c |
+ if(cout != NULL)
|
|
|
09d58c |
+ {
|
|
|
09d58c |
+ fclose(cout);
|
|
|
09d58c |
+ cout = NULL;
|
|
|
09d58c |
+ }
|
|
|
09d58c |
}
|
|
|
09d58c |
if (din && FD_ISSET(fileno(din), &mask)) {
|
|
|
09d58c |
while (read(fileno(din), buf, BUFSIZ) > 0)
|
|
|
09d58c |
--- netkit-ftp-0.17/ftp/main.c.segv 2004-06-14 11:03:18.000000000 -0400
|
|
|
09d58c |
+++ netkit-ftp-0.17/ftp/main.c 2004-06-14 11:03:42.000000000 -0400
|
|
|
09d58c |
@@ -235,8 +235,6 @@
|
|
|
09d58c |
if (connected) {
|
|
|
09d58c |
if (cout != NULL) {
|
|
|
09d58c |
shutdown(fileno(cout), 1+1);
|
|
|
09d58c |
- fclose(cout);
|
|
|
09d58c |
- cout = NULL;
|
|
|
09d58c |
}
|
|
|
09d58c |
if (data >= 0) {
|
|
|
09d58c |
shutdown(data, 1+1);
|
|
|
09d58c |
@@ -249,8 +247,6 @@
|
|
|
09d58c |
if (connected) {
|
|
|
09d58c |
if (cout != NULL) {
|
|
|
09d58c |
shutdown(fileno(cout), 1+1);
|
|
|
09d58c |
- fclose(cout);
|
|
|
09d58c |
- cout = NULL;
|
|
|
09d58c |
}
|
|
|
09d58c |
connected = 0;
|
|
|
09d58c |
}
|