Author: akhaldi
Date: Sat May 30 10:19:49 2015
New Revision: 67963
URL:
http://svn.reactos.org/svn/reactos?rev=67963&view=rev
Log:
[NOTEPAD] Fix array index use before limits check. By Kudratov Olimjon using Cppcheck.
CORE-8978
Modified:
trunk/reactos/base/applications/notepad/dialog.c
Modified: trunk/reactos/base/applications/notepad/dialog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/notepad/…
==============================================================================
--- trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/notepad/dialog.c [iso-8859-1] Sat May 30 10:19:49
2015
@@ -1075,7 +1075,7 @@
SendMessage(Globals.hEdit, EM_GETSEL, (WPARAM) &dwStart, (LPARAM) &dwEnd);
nLine = 1;
- for (i = 0; pszText[i] && (i < (int) dwStart); i++)
+ for (i = 0; (i < (int) dwStart) && pszText[i]; i++)
{
if (pszText[i] == '\n')
nLine++;