From: Amine Khaldi Date: Sat, 30 May 2015 10:21:48 +0000 (+0000) Subject: [FTP] Fix array index use before limits check. By Kudratov Olimjon using Cppcheck... X-Git-Tag: backups/colins-printing-for-freedom@73041~15^2~255 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=0e02eb304d2e102ff01cad2228e6266312a88e45 [FTP] Fix array index use before limits check. By Kudratov Olimjon using Cppcheck. CORE-8978 svn path=/trunk/; revision=67964 --- diff --git a/reactos/base/applications/network/ftp/cmds.c b/reactos/base/applications/network/ftp/cmds.c index 5b4898290ad..b722a2b383d 100644 --- a/reactos/base/applications/network/ftp/cmds.c +++ b/reactos/base/applications/network/ftp/cmds.c @@ -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) {