[Libpst-commits] r44 - trunk

Joseph Nahmias jello at costa.debian.org
Tue Apr 25 17:11:45 UTC 2006


Author: jello
Date: 2006-04-25 17:11:44 +0000 (Tue, 25 Apr 2006)
New Revision: 44

Modified:
   trunk/libpst.c
   trunk/libstrfunc.c
   trunk/readpst.c
Log:
apply fixes from Nigel Horne <njh at bandsman.co.uk>

Modified: trunk/libpst.c
===================================================================
--- trunk/libpst.c	2006-01-16 18:02:06 UTC (rev 43)
+++ trunk/libpst.c	2006-04-25 17:11:44 UTC (rev 44)
@@ -272,6 +272,7 @@
       size = _pst_ff_getID2data(pf, ptr, &h);
     } else {
       DEBUG_WARN(("Couldn't find ID pointer. Cannot save attachment to file\n"));
+      size = 0;
     }
     attach->size = size;
   } else {

Modified: trunk/libstrfunc.c
===================================================================
--- trunk/libstrfunc.c	2006-01-16 18:02:06 UTC (rev 43)
+++ trunk/libstrfunc.c	2006-04-25 17:11:44 UTC (rev 44)
@@ -27,7 +27,7 @@
   //register void *dte=data + size;
   register int nc=0;
   
-  if(data == NULL)
+  if ( data == NULL || size == 0 )
     return NULL;
   
   ou=output=(char *)malloc(size / 3 * 4 + (size / 50) + 5);

Modified: trunk/readpst.c
===================================================================
--- trunk/readpst.c	2006-01-16 18:02:06 UTC (rev 43)
+++ trunk/readpst.c	2006-04-25 17:11:44 UTC (rev 44)
@@ -383,7 +383,7 @@
 	  memset(f->name, 0, 10);
 	  //	    sprintf(f->name, "%09i", f->email_count);
 	} else {
-	  f->name = (char*) xmalloc(strlen(item->file_as)+strlen(OUTPUT_TEMPLATE+1));
+	  f->name = (char*) xmalloc(strlen(item->file_as)+strlen(OUTPUT_TEMPLATE)+1);
 	  sprintf(f->name, OUTPUT_TEMPLATE, item->file_as);
 	}
 




More information about the Libpst-commits mailing list