[FTP] Fix array index use before limits check. By Kudratov Olimjon using Cppcheck...
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 30 May 2015 10:21:48 +0000 (10:21 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 30 May 2015 10:21:48 +0000 (10:21 +0000)
svn path=/trunk/; revision=67964

reactos/base/applications/network/ftp/cmds.c

index 5b48982..b722a2b 100644 (file)
@@ -1842,10 +1842,10 @@ dotrans(const char *name)
     char *cp2 = new;
        register int i, ostop, found;
 
-       for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++);
+       for (ostop = 0; ostop < 16 && *(ntout + ostop); ostop++);
        for (cp1 = name; *cp1; cp1++) {
                found = 0;
-               for (i = 0; *(ntin + i) && i < 16; i++) {
+               for (i = 0; i < 16 && *(ntin + i); i++) {
                        if (*cp1 == *(ntin + i)) {
                                found++;
                                if (i < ostop) {