SF.net SVN: geany: [989] trunk

ntrel at users.sourceforge.net ntrel at xxxxx
Mon Nov 13 16:38:45 UTC 2006


Revision: 989
          http://svn.sourceforge.net/geany/?rev=989&view=rev
Author:   ntrel
Date:     2006-11-13 08:38:39 -0800 (Mon, 13 Nov 2006)

Log Message:
-----------
Fix invalid memory read in sci_cb_get_indent().

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/sci_cb.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-11-12 15:29:40 UTC (rev 988)
+++ trunk/ChangeLog	2006-11-13 16:38:39 UTC (rev 989)
@@ -1,3 +1,8 @@
+2006-11-13  Nick Treleaven  <nick.treleaven at btinternet.com>
+
+ * src/sci_cb.c: Fix invalid memory read in sci_cb_get_indent().
+
+
 2006-11-12  Nick Treleaven  <nick.treleaven at btinternet.com>
 
  * src/vte.c: Fix message window horizontal scrollbar being too tall on

Modified: trunk/src/sci_cb.c
===================================================================
--- trunk/src/sci_cb.c	2006-11-12 15:29:40 UTC (rev 988)
+++ trunk/src/sci_cb.c	2006-11-13 16:38:39 UTC (rev 989)
@@ -354,7 +354,7 @@
 		{
 			gint k = len - 1;
 			if (use_this_line) break;	// break immediately in the case of sci_cb_close_block
-			while (isspace(linebuf[k])) k--;
+			while (k > 0 && isspace(linebuf[k])) k--;
 			// if last non-whitespace character is a { increase indention by a tab
 			// e.g. for (...) {
 			if (linebuf[k] == '{') indent[j++] = '\t';


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list