diff options
Diffstat (limited to 'security/trousers/files/patch-src_include_tcs__utils.h')
-rw-r--r-- | security/trousers/files/patch-src_include_tcs__utils.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/security/trousers/files/patch-src_include_tcs__utils.h b/security/trousers/files/patch-src_include_tcs__utils.h new file mode 100644 index 000000000000..4eee71c78339 --- /dev/null +++ b/security/trousers/files/patch-src_include_tcs__utils.h @@ -0,0 +1,23 @@ +--- src/include/tcs_utils.h.orig 2016-06-20 15:21:26 UTC ++++ src/include/tcs_utils.h +@@ -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; |