source:
npl/system/netkit-ftp/patches/04-netkit-ftp-0.17-segv.patch
@
66e7a2c
Last change on this file since 66e7a2c was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 1.7 KB |
-
netkit-ftp-0.17/ftp/ftp.c
old new 472 472 return (0); 473 473 } 474 474 lostpeer(0); 475 fclose(cout); 476 cout = NULL; 475 477 if (verbose) { 476 478 printf("421 Service not available, remote server has closed connection\n"); 477 479 (void) fflush(stdout); … … 529 531 cpend = 0; 530 532 (void) signal(SIGINT,oldintr); 531 533 if (code == 421 || originalcode == 421) 534 { 532 535 lostpeer(0); 536 if(cout) 537 { 538 fclose(cout); 539 cout = NULL; 540 } 541 } 533 542 if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN) 534 543 (*oldintr)(SIGINT); 535 544 return (n - '0'); … … 1790 1799 if (ptabflg) 1791 1800 code = -1; 1792 1801 lostpeer(0); 1802 if(cout != NULL) 1803 { 1804 fclose(cout); 1805 cout = NULL; 1806 } 1793 1807 } 1794 1808 (void) getreply(0); 1795 1809 (void) getreply(0); … … 1815 1829 perror("reset"); 1816 1830 code = -1; 1817 1831 lostpeer(0); 1832 if(cout != NULL) 1833 { 1834 fclose(cout); 1835 cout = NULL; 1836 } 1818 1837 } 1819 1838 else if (nfnd) { 1820 1839 (void) getreply(0); … … 1897 1916 if (ptabflg) 1898 1917 code = -1; 1899 1918 lostpeer(0); 1919 if(cout != NULL) 1920 { 1921 fclose(cout); 1922 cout = NULL; 1923 } 1900 1924 } 1901 1925 if (din && FD_ISSET(fileno(din), &mask)) { 1902 1926 while (read(fileno(din), buf, BUFSIZ) > 0) -
netkit-ftp-0.17/ftp/main.c
old new 235 235 if (connected) { 236 236 if (cout != NULL) { 237 237 shutdown(fileno(cout), 1+1); 238 fclose(cout);239 cout = NULL;240 238 } 241 239 if (data >= 0) { 242 240 shutdown(data, 1+1); … … 249 247 if (connected) { 250 248 if (cout != NULL) { 251 249 shutdown(fileno(cout), 1+1); 252 fclose(cout);253 cout = NULL;254 250 } 255 251 connected = 0; 256 252 }
Note: See TracBrowser
for help on using the repository browser.