From 911ec92e34119133bafa08a7c00524459337efd9 Mon Sep 17 00:00:00 2001 From: Hyunho Kang Date: Mon, 21 Dec 2015 13:10:00 +0900 Subject: [PATCH] Fix INTEGER OVERFLOW Change-Id: Ia51b62e2dafb28e4282a1e8ea61fbe351074a2df Signed-off-by: Hyunho Kang --- src/data-control-map.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/data-control-map.c b/src/data-control-map.c index 443ca4a..c0a8477 100755 --- a/src/data-control-map.c +++ b/src/data-control-map.c @@ -799,9 +799,9 @@ int datacontrol_map_get_with_page(datacontrol_h provider, const char *key, int * LOGI("Gets the value list from provider_id: %s, data_id: %s", provider->provider_id, provider->data_id); - long long arg_size = (strlen(provider->data_id) + strlen(key)) * sizeof(wchar_t); + unsigned int arg_size = (strlen(provider->data_id) + strlen(key)) * sizeof(wchar_t); if (arg_size > MAX_ARGUMENT_SIZE) { - LOGE("The size of sending argument (%lld) exceeds the maximum limit.", arg_size); + LOGE("The size of sending argument (%u) exceeds the maximum limit.", arg_size); return DATACONTROL_ERROR_MAX_EXCEEDED; } @@ -859,9 +859,9 @@ int datacontrol_map_set(datacontrol_h provider, const char *key, const char *old LOGI("Sets the old value to new value in provider_id: %s, data_id: %s", provider->provider_id, provider->data_id); - long long arg_size = (strlen(provider->data_id) + strlen(key) + strlen(old_value) + strlen(new_value)) * sizeof(wchar_t); + unsigned int arg_size = (strlen(provider->data_id) + strlen(key) + strlen(old_value) + strlen(new_value)) * sizeof(wchar_t); if (arg_size > MAX_ARGUMENT_SIZE) { - LOGE("The size of sending argument (%lld) exceeds the maximum limit.", arg_size); + LOGE("The size of sending argument (%u) exceeds the maximum limit.", arg_size); return DATACONTROL_ERROR_MAX_EXCEEDED; } @@ -901,9 +901,9 @@ int datacontrol_map_add(datacontrol_h provider, const char *key, const char *val LOGI("Adds the value in provider_id: %s, data_id: %s", provider->provider_id, provider->data_id); - long long arg_size = (strlen(provider->data_id) + strlen(key) + strlen(value)) * sizeof(wchar_t); + unsigned int arg_size = (strlen(provider->data_id) + strlen(key) + strlen(value)) * sizeof(wchar_t); if (arg_size > MAX_ARGUMENT_SIZE) { - LOGE("The size of sending argument (%lld) exceeds the maximum limit.", arg_size); + LOGE("The size of sending argument (%u) exceeds the maximum limit.", arg_size); return DATACONTROL_ERROR_MAX_EXCEEDED; } @@ -942,9 +942,9 @@ int datacontrol_map_remove(datacontrol_h provider, const char *key, const char * LOGI("Removes the value in provider_id: %s, data_id: %s", provider->provider_id, provider->data_id); - long long arg_size = (strlen(provider->data_id) + strlen(key) + strlen(value)) * sizeof(wchar_t); + unsigned int arg_size = (strlen(provider->data_id) + strlen(key) + strlen(value)) * sizeof(wchar_t); if (arg_size > MAX_ARGUMENT_SIZE) { - LOGE("The size of sending argument (%lld) exceeds the maximum limit.", arg_size); + LOGE("The size of sending argument (%u) exceeds the maximum limit.", arg_size); return DATACONTROL_ERROR_MAX_EXCEEDED; } -- 2.7.4