allocate BUFSIZ size instead of payload_size when creating packet 56/28956/1 accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_3.0_ivi accepted/tizen_common tizen_3.0.2014.q3_common tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.m14.3_ivi tizen_3.0_ivi accepted/tizen/3.0.2014.q3/common/20141022.093402 accepted/tizen/3.0.m14.3/ivi/20141022.104126 accepted/tizen/common/20141021.112611 accepted/tizen/ivi/20141022.015303 submit/tizen_3.0.2014.q3_common/20141021.112639 submit/tizen_3.0.m14.3_ivi/20141021.112858 submit/tizen_common/20141021.090218 submit/tizen_common/20141021.111902 submit/tizen_ivi/20141021.113442 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.3_ivi_release tizen_3.0_ivi_release
authorCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Fri, 17 Oct 2014 12:17:41 +0000 (14:17 +0200)
committerCorentin Lecouvey <corentin.lecouvey@open.eurogiciel.org>
Fri, 17 Oct 2014 12:24:12 +0000 (14:24 +0200)
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>
src/packet.c

index 6057b56..3c3fb79 100644 (file)
@@ -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;