fix the bug about wrong size value when calling core_calloc

This commit is contained in:
Sukchan Lee
2018-04-11 06:47:28 +09:00
parent a1e06c919f
commit 539d0c7bc5
2 changed files with 2 additions and 2 deletions

View File

@@ -121,7 +121,7 @@ typedef struct _tlv_int32_t {
TLV_CLEAR_DATA(__dST); \
(__dST)->presence = (__sRC)->presence; \
(__dST)->len = (__sRC)->len; \
(__dST)->data = core_calloc(1, sizeof((__dST)->len)); \
(__dST)->data = core_calloc((__dST)->len, sizeof(c_uint8_t)); \
memcpy((__dST)->data, (__sRC)->data, (__dST)->len); \
} while(0)
typedef struct _tlv_octet_t {

View File

@@ -24,7 +24,7 @@ extern "C" {
d_assert((__dST),, "Null param") \
NAS_CLEAR_DATA(__dST); \
(__dST)->length = (__sRC)->length; \
(__dST)->buffer = core_calloc(1, sizeof((__dST)->length)); \
(__dST)->buffer = core_calloc((__dST)->length, sizeof(c_uint8_t)); \
memcpy((__dST)->buffer, (__sRC)->buffer, (__dST)->length); \
} while(0)