summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-jae Park <nicesj.park@samsung.com>2015-05-01 16:45:14 +0900
committerSung-jae Park <nicesj.park@samsung.com>2015-05-01 16:45:14 +0900
commit1088b20756c23796c43c20e1fa97cb0b7fbb1e79 (patch)
tree538ec730a042b03cd526677bf6eab1e7c6a97b5f
parentd897d062c40bdad08fd387ce3d5504de79e8f29a (diff)
downloadcom-core-1088b20756c23796c43c20e1fa97cb0b7fbb1e79.tar.gz
com-core-1088b20756c23796c43c20e1fa97cb0b7fbb1e79.tar.bz2
com-core-1088b20756c23796c43c20e1fa97cb0b7fbb1e79.zip
At least now, while I make a product using this code. There is no such problem what I read from history in Tizen 3.0. If the crash occurred when allocating heap more large size than BUFSIZ, It mean somewhere else is broken. It could be caller of this function. The problem should be invetigated again. If you really think that the problem is caused by this. Please let me know it. contact to me. We need discuss it. [model] Redwood,Kiran,B3(Wearable) [binary_type] AP [customer] Docomo/Orange/ATT/Open [issue#] N/A [problem] [cause] [solution] [team] HomeTF [request] [horizontal_expansion] Change-Id: I3b3c46b7c023a5805a4bb63081049e9a534e9ecc
-rw-r--r--src/packet.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/packet.c b/src/packet.c
index edf3158..ffdca79 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -337,7 +337,7 @@ EAPI struct packet *packet_create_reply(const struct packet *packet, const char
payload_size = sizeof(*result->data) + BUFSIZ;
result->refcnt = 0;
- result->data = calloc(1, BUFSIZ);
+ result->data = calloc(1, payload_size);
if (!result->data) {
ErrPrint("Heap: %s\n", strerror(errno));
result->state = INVALID;
@@ -406,7 +406,7 @@ EAPI struct packet *packet_create(const char *cmd, const char *fmt, ...)
payload_size = sizeof(*packet->data) + BUFSIZ;
packet->refcnt = 0;
- packet->data = calloc(1, BUFSIZ);
+ packet->data = calloc(1, payload_size);
if (!packet->data) {
ErrPrint("Heap: %s\n", strerror(errno));
packet->state = INVALID;
@@ -459,7 +459,7 @@ EAPI struct packet *packet_create_noack(const char *cmd, const char *fmt, ...)
payload_size = sizeof(*result->data) + BUFSIZ;
result->refcnt = 0;
- result->data = calloc(1, BUFSIZ);
+ result->data = calloc(1, payload_size);
if (!result->data) {
ErrPrint("Heap: %s\n", strerror(errno));
result->state = INVALID;