blob: fcbe1d2f9d1c987702ad0fc3e91d8fc577d1a1a6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
--- src/include/tcs_utils.h.orig 2010-01-29 01:27:51.000000000 +0900
+++ src/include/tcs_utils.h 2010-10-24 21:04:04.824555399 +0900
@@ -18,6 +18,20 @@
#include "tcs_tsp.h"
#include "trousers_types.h"
+
+
+/*
+ * XXX malloc wrapper
+ *
+ * Linux: malloc(0) => '\0'
+ * *BSD: malloc(0) => invalid to dereference
+ *
+ * => so wrap malloc(0) => calloc(1, 16) to create
+ * a 16Byte array containing '\0'
+ *
+ */
+#define malloc(x) ((x) == 0 ? calloc(1, 16) : calloc(1, (x)))
+
struct key_mem_cache
{
TCPA_KEY_HANDLE tpm_handle;
|