Author: wlux
Date: Mon Aug 25 23:20:32 2014
New Revision: 38050

URL: http://svn.gna.org/viewcvs/gnustep?rev=38050&view=rev
Log:
Fix condition order to prevent out of range array accesses, which may
lead to a segfault when unhighlighting two matching parentheses.

Fix by Markus <[email protected]>.

Modified:
    apps/projectcenter/trunk/ChangeLog
    apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditor.m

Modified: apps/projectcenter/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/ChangeLog?rev=38050&r1=38049&r2=38050&view=diff
==============================================================================
--- apps/projectcenter/trunk/ChangeLog  (original)
+++ apps/projectcenter/trunk/ChangeLog  Mon Aug 25 23:20:32 2014
@@ -1,3 +1,13 @@
+2014-08-25  Wolfgang Lux  <[email protected]>
+
+       * Modules/Editors/ProjectCenter/PCEditor.m (unhighlightCharacter:):
+       * Modules/Editors/ProjectCenter/PCEditor.m
+       (highlightCharacterAt:inEditor:):
+       Fix condition order to prevent out of range array accesses, which
+       may lead to a segfault when unhighlighting two matching parentheses.
+
+       Fix by Markus <[email protected]>.
+
 2014-08-18 16:07-EDT Gregory John Casamento <[email protected]>
 
        * Modules/Projects/Aggregate/Resources/Inspector.gorm

Modified: apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditor.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditor.m?rev=38050&r1=38049&r2=38050&view=diff
==============================================================================
--- apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditor.m   
(original)
+++ apps/projectcenter/trunk/Modules/Editors/ProjectCenter/PCEditor.m   Mon Aug 
25 23:20:32 2014
@@ -1228,7 +1228,7 @@
   [textStorage beginEditing];
 
 //  if (isCharacterHighlit)
-  for (i = 0; (highlited_chars[i] != -1 && i < 2); i++)
+  for (i = 0; i < 2 && highlited_chars[i] != -1; i++)
     {
       NSRange       r = NSMakeRange(highlited_chars[i], 1);
 //      NSRange       r = NSMakeRange(highlitCharacterLocation, i);
@@ -1282,7 +1282,7 @@
 {
   int i;
 
-  for (i = 0; highlited_chars[i] != -1; i++) {};
+  for (i = 0; i < 2 && highlited_chars[i] != -1; i++) {};
 
 //  if (isCharacterHighlit == NO)
   if (i < 2)


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to