[sword-svn] r2021 - trunk/src/modules/common

dglassey at www.crosswire.org dglassey at www.crosswire.org
Fri Dec 8 08:59:45 MST 2006


Author: dglassey
Date: 2006-12-08 08:59:45 -0700 (Fri, 08 Dec 2006)
New Revision: 2021

Modified:
   trunk/src/modules/common/entriesblk.cpp
Log:
size must be at least one - so check it isn't zero


Modified: trunk/src/modules/common/entriesblk.cpp
===================================================================
--- trunk/src/modules/common/entriesblk.cpp	2006-12-08 10:57:11 UTC (rev 2020)
+++ trunk/src/modules/common/entriesblk.cpp	2006-12-08 15:59:45 UTC (rev 2021)
@@ -10,8 +10,13 @@
 	// offset(4); size(4);
 
 EntriesBlock::EntriesBlock(const char *iBlock, unsigned long size) {
-	block = (char *)calloc(1, size);
-	memcpy(block, iBlock, size);
+	if (size) {
+		block = (char *)calloc(1, size);
+		memcpy(block, iBlock, size);
+	}
+	else {
+		block = (char *)calloc(1, sizeof(__u32));
+	}
 }
 
 




More information about the sword-cvs mailing list