From 85269e2dd0e16fd22aa21a2b9680a67c56455b8f Mon Sep 17 00:00:00 2001 From: Dewal Agarwal Date: Mon, 31 Oct 2022 15:09:36 +0530 Subject: [PATCH] [TSEVEN-2228] Prevent stack-buffer overflow Change-Id: Ic4c9cc04ec57099f1fe8053bf54f5eeeb9e62dfb Signed-off-by: Dewal Agarwal --- common/ctsvc_vcard.c | 4 ++-- packaging/contacts-service.spec | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common/ctsvc_vcard.c b/common/ctsvc_vcard.c index 12a13aa..443efa8 100644 --- a/common/ctsvc_vcard.c +++ b/common/ctsvc_vcard.c @@ -2104,7 +2104,7 @@ EXPORT_API int contacts_vcard_make_from_my_profile(contacts_record_h record, cha #ifdef _CONTACTS_IPC_CLIENT static int __ctsvc_vcard_append_person(ctsvc_person_s *person, ctsvc_list_s *list_contacts, char **buf, int *buf_size, int len) { - int changed_time = 0; + time_t changed_time = 0; ctsvc_contact_s *contact; GList *cursor = NULL; @@ -2214,7 +2214,7 @@ static int __ctsvc_vcard_append_person(ctsvc_person_s *person, ctsvc_list_s *lis if (changed_time) { struct tm ts; - gmtime_r((time_t*)&changed_time, &ts); + gmtime_r(&changed_time, &ts); char temp[VCARD_ITEM_LENGTH] = {0}; snprintf(temp, sizeof(temp), "%s:%04d-%02d-%02dT%02d:%02d:%02dZ%s", content_name[CTSVC_VCARD_VALUE_REV], diff --git a/packaging/contacts-service.spec b/packaging/contacts-service.spec index 5d41788..e30e56a 100644 --- a/packaging/contacts-service.spec +++ b/packaging/contacts-service.spec @@ -1,6 +1,6 @@ Name: contacts-service Summary: Contacts Service -Version: 0.13.77 +Version: 0.13.78 Release: 0 Group: Social & Content/Service License: Apache-2.0 -- 2.7.4