fix for buffer overflow 80/210880/1
authorSameer Prakash Pradhan <sp.pradhan@samsung.com>
Thu, 25 Jul 2019 13:14:58 +0000 (18:44 +0530)
committerSameer Prakash Pradhan <sp.pradhan@samsung.com>
Thu, 25 Jul 2019 13:14:58 +0000 (18:44 +0530)
Change-Id: I2a3e84b7dedd89f0902042c1c9eccce6f64f7199
Signed-off-by: Sameer Prakash Pradhan <sp.pradhan@samsung.com>
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");