Author: akhaldi
Date: Sat May 30 10:21:48 2015
New Revision: 67964
URL:
http://svn.reactos.org/svn/reactos?rev=67964&view=rev
Log:
[FTP] Fix array index use before limits check. By Kudratov Olimjon using Cppcheck.
CORE-8978
Modified:
trunk/reactos/base/applications/network/ftp/cmds.c
Modified: trunk/reactos/base/applications/network/ftp/cmds.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/ftp/cmds.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/ftp/cmds.c [iso-8859-1] Sat May 30 10:21:48
2015
@@ -1842,10 +1842,10 @@
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) {