Merge "fix for buffer overflow" into tizen
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>
Fri, 26 Jul 2019 05:13:50 +0000 (05:13 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Fri, 26 Jul 2019 05:13:50 +0000 (05:13 +0000)
server/db/ctsvc_db_plugin_contact.c

index 1507269..0ba4551 100644 (file)
@@ -1596,7 +1596,7 @@ static int __ctsvc_db_contact_get_records_with_query(contacts_query_h query, int
        }
 
        if (false == had_contact_id) {
-               void *tmp = realloc(s_query->projection, s_query->projection_count+1);
+               void *tmp = realloc(s_query->projection, sizeof(unsigned int)*(s_query->projection_count+1));
                if (NULL == tmp) {
                        /* LCOV_EXCL_START */
                        ERR("realloc() Fail");