gnome-keyring r1717 - in branches/gnome-2-26: . egg egg/tests



Author: stefw
Date: Fri Apr 10 21:33:45 2009
New Revision: 1717
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1717&view=rev

Log:
Fix problem with integer overflow in memory allocator.

Modified:
   branches/gnome-2-26/ChangeLog
   branches/gnome-2-26/egg/egg-secure-memory.c
   branches/gnome-2-26/egg/tests/unit-test-secmem.c

Modified: branches/gnome-2-26/egg/egg-secure-memory.c
==============================================================================
--- branches/gnome-2-26/egg/egg-secure-memory.c	(original)
+++ branches/gnome-2-26/egg/egg-secure-memory.c	Fri Apr 10 21:33:45 2009
@@ -661,7 +661,7 @@
 			break;
 		
 		/* Eat the whole neighbor if not too big */
-		if (n_words - cell->n_words >= other->n_words + WASTE) {
+		if (n_words - cell->n_words + WASTE >= other->n_words) {
 			cell->n_words += other->n_words;
 			sec_write_guards (cell);
 			sec_remove_cell_ring (&block->unused, other);

Modified: branches/gnome-2-26/egg/tests/unit-test-secmem.c
==============================================================================
--- branches/gnome-2-26/egg/tests/unit-test-secmem.c	(original)
+++ branches/gnome-2-26/egg/tests/unit-test-secmem.c	Fri Apr 10 21:33:45 2009
@@ -156,7 +156,7 @@
 
 		/* Determine what we want to do */
 		if (memory->len > 0) {
-			if (i > 1000) /* Once we've done 1000 alocations start freeing */
+			if (i > 100000) /* Once we've done 100000 alocations start freeing */
 				action = 2;
 			else
 				action = g_random_int_range (0, 3);
@@ -195,7 +195,7 @@
 		
 		egg_secure_validate ();
 		
-		if (i > 1000 && !memory->len)
+		if (i > 100000 && !memory->len)
 			break;
 	}
 	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]