Use malloced memory instead of stack-allocated, so that MALLOC_CHECK_=2
authorMatthias Clasen <mclasen@redhat.com>
Wed, 3 May 2006 12:23:44 +0000 (12:23 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 3 May 2006 12:23:44 +0000 (12:23 +0000)
2006-05-03  Matthias Clasen  <mclasen@redhat.com>

* tests/base64-test.c (test_incremental): Use malloced memory
instead of stack-allocated, so that MALLOC_CHECK_=2 catches
the OOB write...

ChangeLog
ChangeLog.pre-2-12
tests/base64-test.c

index ef05f14..914f60f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2006-05-03  Matthias Clasen  <mclasen@redhat.com>
+
+       * tests/base64-test.c (test_incremental): Use malloced memory
+       instead of stack-allocated, so that MALLOC_CHECK_=2 catches
+       the OOB write...
+
+       * glib/gbookmarkfile.c (g_bookmark_file_load_from_data): Remove
+       an overzealous return_if_fail check that causes make check to 
+       fail.
+
 2006-05-02  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index ef05f14..914f60f 100644 (file)
@@ -1,3 +1,13 @@
+2006-05-03  Matthias Clasen  <mclasen@redhat.com>
+
+       * tests/base64-test.c (test_incremental): Use malloced memory
+       instead of stack-allocated, so that MALLOC_CHECK_=2 catches
+       the OOB write...
+
+       * glib/gbookmarkfile.c (g_bookmark_file_load_from_data): Remove
+       an overzealous return_if_fail check that causes make check to 
+       fail.
+
 2006-05-02  Matthias Clasen  <mclasen@redhat.com>
 
        * configure.in: Bump version
index 6c458d2..6484988 100644 (file)
@@ -11,13 +11,16 @@ static guchar data[DATA_SIZE];
 static void
 test_incremental (gboolean line_break)
 {
-  char text[DATA_SIZE * 2];
   char *p;
-  guchar data2[DATA_SIZE];
   int i;
   gsize len, decoded_len, max;
   int state, save;
   guint decoder_save;
+  char *text;
+  guchar *data2;
+
+  data2 = g_malloc (DATA_SIZE);
+  text = g_malloc (DATA_SIZE * 2);
 
   len = 0;
   state = 0;
@@ -65,6 +68,9 @@ test_incremental (gboolean line_break)
       g_print ("Wrong decoded base64 data\n");
       exit (1);
     }
+
+  g_free (text);
+  g_free (data2);
 }
 
 static void
@@ -90,6 +96,8 @@ test_full (void)
       g_print ("Wrong decoded base64 data\n");
       exit (1);
     }
+
+  g_free (data2);
 }
 
 int