From: Jihoon Kim Date: Tue, 31 May 2022 02:13:37 +0000 (+0900) Subject: Fix issue detected by static analysis tool X-Git-Tag: submit/tizen/20220617.052105~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1edfcdb82af1b1647f4e3fa6abbad40c4c9a0354;p=platform%2Fcore%2Fuifw%2Fmulti-assistant.git Fix issue detected by static analysis tool Change-Id: I7c87352524ffe97d5fb067c10319654227ed4a75 Signed-off-by: Jihoon Kim --- diff --git a/client/ma_ap_dbus.c b/client/ma_ap_dbus.c index 3d1d7bb..3776c79 100644 --- a/client/ma_ap_dbus.c +++ b/client/ma_ap_dbus.c @@ -60,7 +60,7 @@ static void message_port_cb(int local_port_id, static char pending_buffer[STREAMING_BUFFER_SIZE * 2]; static unsigned int pending_buffer_size = 0; - char buffer[STREAMING_BUFFER_SIZE]; + char buffer[STREAMING_BUFFER_SIZE] = {0}; size_t size; unsigned char *v = NULL; @@ -70,7 +70,8 @@ static void message_port_cb(int local_port_id, MA_SLOGE("[ERROR] bundle contains data bigger than %d : %zu", STREAMING_BUFFER_SIZE, size); return; } else { - memcpy(buffer, v, size); + if (v) + memcpy(buffer, v, size); } memcpy(pending_buffer + pending_buffer_size, buffer, size);