Subversion Repositories tpanel

Rev

Rev 391 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 391 Rev 401
Line 754... Line 754...
754
        buf[i++] = ' ';
754
        buf[i++] = ' ';
755
 
755
 
756
        if ((strlen(path) + i) >= sizeof(buf))
756
        if ((strlen(path) + i) >= sizeof(buf))
757
            return 0;
757
            return 0;
758
 
758
 
759
        strcpy(&buf[i], path);
759
        strncpy(&buf[i], path, sizeof(buf));
760
    }
760
    }
761
 
761
 
762
    if (nControl->cmode == ftplib::pasv)
762
    if (nControl->cmode == ftplib::pasv)
763
    {
763
    {
764
        if (FtpOpenPasv(nControl, nData, mode, dir, buf) == -1)
764
        if (FtpOpenPasv(nControl, nData, mode, dir, buf) == -1)
Line 1761... Line 1761...
1761
            buf[i++] = ' ';
1761
            buf[i++] = ' ';
1762
 
1762
 
1763
            if ((strlen(pathSrc) + i) >= sizeof(buf))
1763
            if ((strlen(pathSrc) + i) >= sizeof(buf))
1764
                return 0;
1764
                return 0;
1765
 
1765
 
1766
            strcpy(&buf[i], pathSrc);
1766
            strncpy(&buf[i], pathSrc, sizeof(buf));
1767
        }
1767
        }
1768
 
1768
 
1769
        if (!src->FtpSendCmd(buf, '1', src->mp_ftphandle))
1769
        if (!src->FtpSendCmd(buf, '1', src->mp_ftphandle))
1770
            return 0;
1770
            return 0;
1771
 
1771
 
Line 1779... Line 1779...
1779
            buf[i++] = ' ';
1779
            buf[i++] = ' ';
1780
 
1780
 
1781
            if ((strlen(pathDst) + i) >= sizeof(buf))
1781
            if ((strlen(pathDst) + i) >= sizeof(buf))
1782
                return 0;
1782
                return 0;
1783
 
1783
 
1784
            strcpy(&buf[i], pathDst);
1784
            strncpy(&buf[i], pathDst, sizeof(buf));
1785
        }
1785
        }
1786
 
1786
 
1787
        if (!dst->FtpSendCmd(buf, '1', dst->mp_ftphandle))
1787
        if (!dst->FtpSendCmd(buf, '1', dst->mp_ftphandle))
1788
        {
1788
        {
1789
            /* this closes the data connection, to abort the RETR on
1789
            /* this closes the data connection, to abort the RETR on
Line 1835... Line 1835...
1835
            buf[i++] = ' ';
1835
            buf[i++] = ' ';
1836
 
1836
 
1837
            if ((strlen(pathDst) + i) >= sizeof(buf))
1837
            if ((strlen(pathDst) + i) >= sizeof(buf))
1838
                return 0;
1838
                return 0;
1839
 
1839
 
1840
            strcpy(&buf[i], pathDst);
1840
            strncpy(&buf[i], pathDst, sizeof(buf));
1841
        }
1841
        }
1842
 
1842
 
1843
        if (!dst->FtpSendCmd(buf, '1', dst->mp_ftphandle))
1843
        if (!dst->FtpSendCmd(buf, '1', dst->mp_ftphandle))
1844
            return 0;
1844
            return 0;
1845
 
1845
 
Line 1853... Line 1853...
1853
            buf[i++] = ' ';
1853
            buf[i++] = ' ';
1854
 
1854
 
1855
            if ((strlen(pathSrc) + i) >= sizeof(buf))
1855
            if ((strlen(pathSrc) + i) >= sizeof(buf))
1856
                return 0;
1856
                return 0;
1857
 
1857
 
1858
            strcpy(&buf[i], pathSrc);
1858
            strncpy(&buf[i], pathSrc, sizeof(buf));
1859
        }
1859
        }
1860
 
1860
 
1861
        if (!src->FtpSendCmd(buf, '1', src->mp_ftphandle))
1861
        if (!src->FtpSendCmd(buf, '1', src->mp_ftphandle))
1862
        {
1862
        {
1863
            src->FtpSendCmd("PASV", '2', src->mp_ftphandle);
1863
            src->FtpSendCmd("PASV", '2', src->mp_ftphandle);