From: sinikang Date: Thu, 21 May 2020 05:30:26 +0000 (+0900) Subject: Fix Asan build error X-Git-Tag: submit/tizen/20200527.011828^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f91c2549cdddac54f15f16a330925d9312bae531;p=platform%2Fcore%2Fapi%2Ftelephony.git Fix Asan build error - use g_strlcpy() to fix striongop-truncaton error Change-Id: I8afabbd462cb685b4027347cec314dc8e30b9d01 Signed-off-by: sinikang --- diff --git a/packaging/capi-telephony.spec b/packaging/capi-telephony.spec index 24ffeee..c4acdea 100644 --- a/packaging/capi-telephony.spec +++ b/packaging/capi-telephony.spec @@ -1,6 +1,6 @@ Name: capi-telephony Summary: Telephony Core API -Version: 0.1.85 +Version: 0.1.86 Release: 1 Group: System/Libraries License: Apache-2.0 diff --git a/src/telephony_call.c b/src/telephony_call.c index f0df76d..558f37f 100644 --- a/src/telephony_call.c +++ b/src/telephony_call.c @@ -70,8 +70,7 @@ static void _get_call_status_cb(TelCallStatus_t *status, void *user_data) call_info->direction = status->bMoCall ? TELEPHONY_CALL_DIRECTION_MO : TELEPHONY_CALL_DIRECTION_MT; call_info->conference_status = status->bConferenceState; _mapping_call_status(status->CallState, &call_info->status); - strncpy(call_info->number, status->pNumber, TELEPHONY_CALL_NUMBER_LEN_MAX); - call_info->number[TELEPHONY_CALL_NUMBER_LEN_MAX] = '\0'; // just for fixing compile warning + g_strlcpy(call_info->number, status->pNumber, TELEPHONY_CALL_NUMBER_LEN_MAX + 1); LOGI("id[%d] number[%s] type[%s] status[%s] direction[%s] conference_status[%s]", call_info->id, call_info->number,