diff options
author | Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org> | 2014-10-17 14:17:41 +0200 |
---|---|---|
committer | Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org> | 2014-10-17 14:24:12 +0200 |
commit | dbfd87c27e0f73b95b2ae16d0b76e059484d5375 (patch) | |
tree | 0dffc33272bbf9ea11528e0018ee598a97ad0fa5 | |
parent | 15d9dee4aa77064669ddd4bccddaeaccd3865f21 (diff) | |
download | com-core-accepted/tizen_common.tar.gz com-core-accepted/tizen_common.tar.bz2 com-core-accepted/tizen_common.zip |
allocate BUFSIZ size instead of payload_size when creating packettizen_3.0_ivi_releasetizen_3.0.m14.3_ivi_releasetizen_3.0.2014.q3_common_releasesubmit/tizen_mobile/20141120.000000submit/tizen_ivi/20141021.113442submit/tizen_common/20141021.111902submit/tizen_common/20141021.090218submit/tizen_3.0.m14.3_ivi/20141021.112858submit/tizen_3.0.2014.q3_common/20141021.112639accepted/tizen/ivi/20141022.015303accepted/tizen/common/20141021.112611accepted/tizen/3.0.m14.3/ivi/20141022.104126accepted/tizen/3.0.2014.q3/common/20141022.093402tizen_3.0_ivitizen_3.0.m14.3_ivitizen_3.0.2015.q1_commontizen_3.0.2014.q4_commontizen_3.0.2014.q3_commonaccepted/tizen_commonaccepted/tizen_3.0_iviaccepted/tizen_3.0.m14.3_iviaccepted/tizen_3.0.2014.q3_common
Using notification API, it appears that allocating payload_size
when creating a packet could makes notification-service crash sometimes
when removing a notification.
Checking some packet sizes shows that allocates BUFSIZ is enough and
fix the problem.
Change-Id: I4b1d134fe43b235b586ba184053134299cc56cb0
Signed-off-by: Corentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
-rw-r--r-- | src/packet.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/packet.c b/src/packet.c index 6057b56..3c3fb79 100644 --- a/src/packet.c +++ b/src/packet.c @@ -378,7 +378,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, payload_size); + packet->data = calloc(1, BUFSIZ); if (!packet->data) { ErrPrint("Heap: %s\n", strerror(errno)); packet->state = INVALID; |