[libpst-commits] r85 - trunk

Chris Halls halls at alioth.debian.org
Mon Jan 29 20:06:10 CET 2007


Author: halls
Date: 2007-01-29 20:06:09 +0100 (Mon, 29 Jan 2007)
New Revision: 85

Modified:
   trunk/ChangeLog
   trunk/debug.c
Log:
Fix memory and information leak in hex debug dump


Index: trunk/debug.c
===================================================================
--- trunk/debug.c	(revision 84)
+++ trunk/debug.c	(revision 85)
@@ -409,6 +409,8 @@
   int index_pos, file_pos;
   char zero='\0';
   index[0] = 1; // only one item in this index run
+  index[1] = 0; // Unused
+  index[2] = 0; // Unused
   index_pos = ftell(debug_fp);
   fwrite(index, index_size, 1, debug_fp);
   index[1] = ftell(debug_fp);
@@ -421,6 +423,7 @@
   lfile_rec.funcname = 0;
   lfile_rec.filename = strlen(item->function)+1;
   lfile_rec.text = lfile_rec.filename+strlen(item->file)+1;
+  lfile_rec.end = 0; // Unused
   fwrite(&lfile_rec, sizeof(lfile_rec), 1, debug_fp);
 
   file_pos = ftell(debug_fp);
@@ -437,6 +440,7 @@
   fwrite(&rec_type, 1, sizeof(char), debug_fp);
   fwrite(&lfile_rec, sizeof(lfile_rec), 1, debug_fp);
   fseek(debug_fp, 0, SEEK_END);
+  free(index);
 }
   
 void * xmalloc(size_t size) {
Index: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	(revision 84)
+++ trunk/ChangeLog	(revision 85)
@@ -11,6 +11,7 @@
 	    (SourceForge #304199)
       * Fix crash caused by invalid free calls
 	  * Fix crash when email subject is empty
+	* Fix memory and information leak in hex debug dump
 
 --
 



More information about the libpst-commits mailing list