source: npl/system/netkit-ftp/patches/04-netkit-ftp-0.17-segv.patch @ a2d969e

perl-5.22
Last change on this file since a2d969e was c5c522c, checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago

initial commit, transferred from cleaned syn3 svn tree

  • Property mode set to 100644
File size: 1.7 KB
  • netkit-ftp-0.17/ftp/ftp.c

    old new  
    472472                                        return (0);
    473473                                }
    474474                                lostpeer(0);
     475                                fclose(cout);
     476                                cout = NULL;
    475477                                if (verbose) {
    476478                                        printf("421 Service not available, remote server has closed connection\n");
    477479                                        (void) fflush(stdout);
     
    529531                        cpend = 0;
    530532                (void) signal(SIGINT,oldintr);
    531533                if (code == 421 || originalcode == 421)
     534                {
    532535                        lostpeer(0);
     536                        if(cout)
     537                        {
     538                                fclose(cout);
     539                                cout = NULL;
     540                        }
     541                }
    533542                if (abrtflag && oldintr != cmdabort && oldintr != SIG_IGN)
    534543                        (*oldintr)(SIGINT);
    535544                return (n - '0');
     
    17901799                        if (ptabflg)
    17911800                                code = -1;
    17921801                        lostpeer(0);
     1802                        if(cout != NULL)
     1803                        {
     1804                                fclose(cout);
     1805                                cout = NULL;
     1806                        }
    17931807                }
    17941808                (void) getreply(0);
    17951809                (void) getreply(0);
     
    18151829                        perror("reset");
    18161830                        code = -1;
    18171831                        lostpeer(0);
     1832                        if(cout != NULL)
     1833                        {
     1834                                fclose(cout);
     1835                                cout = NULL;
     1836                        }
    18181837                }
    18191838                else if (nfnd) {
    18201839                        (void) getreply(0);
     
    18971916                if (ptabflg)
    18981917                        code = -1;
    18991918                lostpeer(0);
     1919                if(cout != NULL)
     1920                {
     1921                        fclose(cout);
     1922                        cout = NULL;
     1923                }
    19001924        }
    19011925        if (din && FD_ISSET(fileno(din), &mask)) {
    19021926                while (read(fileno(din), buf, BUFSIZ) > 0)
  • netkit-ftp-0.17/ftp/main.c

    old new  
    235235        if (connected) {
    236236                if (cout != NULL) {
    237237                        shutdown(fileno(cout), 1+1);
    238                         fclose(cout);
    239                         cout = NULL;
    240238                }
    241239                if (data >= 0) {
    242240                        shutdown(data, 1+1);
     
    249247        if (connected) {
    250248                if (cout != NULL) {
    251249                        shutdown(fileno(cout), 1+1);
    252                         fclose(cout);
    253                         cout = NULL;
    254250                }
    255251                connected = 0;
    256252        }
Note: See TracBrowser for help on using the repository browser.