Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 273836
Collapse All | Expand All

(-)kftpgrabber-0.8.1.old/kftpgrabber/src/engine/ftpsocket.cpp (-3 / +3 lines)
Lines 758-764 Link Here
758
        }
758
        }
759
        
759
        
760
        // 229 Entering Extended Passive Mode (|||55016|)
760
        // 229 Entering Extended Passive Mode (|||55016|)
761
        char *begin = strchr(socket()->getResponse().ascii(), '(');
761
        const char *begin = strchr(socket()->getResponse().ascii(), '(');
762
        int port;
762
        int port;
763
      
763
      
764
        if (!begin || sscanf(begin, "(|||%d|)", &port) != 1) {
764
        if (!begin || sscanf(begin, "(|||%d|)", &port) != 1) {
Lines 793-803 Link Here
793
        
793
        
794
        // Ok PASV command successfull - let's parse the result
794
        // Ok PASV command successfull - let's parse the result
795
        int ip[6];
795
        int ip[6];
796
        char *begin = strchr(socket()->getResponse().ascii(), '(');
796
        const char *begin = strchr(socket()->getResponse().ascii(), '(');
797
      
797
      
798
        // Some stinky servers don't respect RFC and do it on their own
798
        // Some stinky servers don't respect RFC and do it on their own
799
        if (!begin)
799
        if (!begin)
800
          begin = strchr(socket()->getResponse().ascii(), '=');
800
          begin = const_cast<char*> (strchr(socket()->getResponse().ascii(), '='));
801
      
801
      
802
        if (!begin || (sscanf(begin, "(%d,%d,%d,%d,%d,%d)",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6 &&
802
        if (!begin || (sscanf(begin, "(%d,%d,%d,%d,%d,%d)",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6 &&
803
                       sscanf(begin, "=%d,%d,%d,%d,%d,%d",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6)) {
803
                       sscanf(begin, "=%d,%d,%d,%d,%d,%d",&ip[0], &ip[1], &ip[2], &ip[3], &ip[4], &ip[5]) != 6)) {

Return to bug 273836