From: Yu Jiung Date: Thu, 3 Mar 2016 00:20:04 +0000 (+0900) Subject: Fix SVace issues WGID 1937, 1996, 4732, 4936 X-Git-Tag: accepted/tizen/common/20160308.142602~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F60888%2F1;p=apps%2Fnative%2Fug-wifi-direct.git Fix SVace issues WGID 1937, 1996, 4732, 4936 Change-Id: I9359d176db928d7c3eaf06d47f278e7b6c5a1b5d Signed-off-by: Yu jiung --- diff --git a/packaging/libug-setting-wifidirect-efl.spec b/packaging/libug-setting-wifidirect-efl.spec index 237d901..423d078 100644 --- a/packaging/libug-setting-wifidirect-efl.spec +++ b/packaging/libug-setting-wifidirect-efl.spec @@ -3,7 +3,7 @@ Name: libug-setting-wifidirect-efl Summary: Wi-Fi Direct setting UI gadget -Version: 1.11.66 +Version: 1.11.67 Release: 1 Group: App/Network License: Flora-1.1 diff --git a/popup-wifidirect/src/wfd-app-popup-view.c b/popup-wifidirect/src/wfd-app-popup-view.c index 9541761..b711ef4 100755 --- a/popup-wifidirect/src/wfd-app-popup-view.c +++ b/popup-wifidirect/src/wfd-app-popup-view.c @@ -551,6 +551,7 @@ static Eina_Bool _keypad_popup_timer_cb(void *data) char msg1[WFD_POP_STR_MAX_LEN] = {0}; char msg2[WFD_POP_STR_MAX_LEN] = {0}; + char label_str[WFD_POP_STR_MAX_LEN] = {0, }; Evas_Object *label = (Evas_Object*) data; wfd_appdata_t *ad = wfd_get_appdata(); @@ -569,11 +570,10 @@ static Eina_Bool _keypad_popup_timer_cb(void *data) _("IDS_ST_BODY_CONNECT_WITH_PS_IN_PD_SECS_ABB"), connection->peer_name, keypad_popup_timeout); - strcat(msg1, " "); snprintf(msg2, sizeof(msg2), _("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS"), connection->peer_name); - strcat(msg1, msg2); - elm_object_domain_translatable_text_set(label, PACKAGE, msg1); + snprintf(label_str, sizeof(label_str), "%s %s", msg1, msg2); + elm_object_domain_translatable_text_set(label, PACKAGE, label_str); } @@ -836,6 +836,7 @@ static char *__wfd_main_desc_label_get(void *data, Evas_Object *obj, WFD_APP_LOG(WFD_APP_LOG_LOW, "wfd_rename desc\n"); char msg1[WFD_POP_STR_MAX_LEN] = {0, }; char msg2[WFD_POP_STR_MAX_LEN] = {0, }; + char label_str[WFD_POP_STR_MAX_LEN] = {0, }; wfd_appdata_t *ad = wfd_get_appdata(); WFD_RETV_IF(ad == NULL, NULL, "Incorrect parameter(NULL)\n"); wfd_connection_info_s *connection = ad->connection; @@ -849,12 +850,11 @@ static char *__wfd_main_desc_label_get(void *data, Evas_Object *obj, _("IDS_ST_BODY_CONNECT_WITH_PS_IN_PD_SECS_ABB"), connection->peer_name, ad->timeout); - strcat(msg1, " "); snprintf(msg2, sizeof(msg2), _("IDS_WIFI_POP_ENTER_PIN_TO_CONNECT_TO_PS"), connection->peer_name); - strcat(msg1, msg2); - WFD_APP_LOG(WFD_APP_LOG_LOW, "string %s", msg1); + snprintf(label_str, sizeof(label_str), "%s %s", msg1, msg2); + WFD_APP_LOG(WFD_APP_LOG_LOW, "string %s", label_str); __WFD_APP_FUNC_EXIT__; return g_strdup(msg1); } diff --git a/ug-wifidirect/include/wfd_ug.h b/ug-wifidirect/include/wfd_ug.h index 4e1e585..a488d96 100644 --- a/ug-wifidirect/include/wfd_ug.h +++ b/ug-wifidirect/include/wfd_ug.h @@ -63,6 +63,8 @@ #define VCONF_WFD_APNAME "db/setting/device_name" +#define MAX_HEX_COLOR_LENGTH 255 + #define assertm_if(expr, fmt, arg...) do { \ if (expr) { \ DBG(LOG_VERBOSE, " ##(%s) -> %s() assert!!## "fmt, #expr, __FUNCTION__, ##arg); \ diff --git a/ug-wifidirect/src/wfd_ug_genlist.c b/ug-wifidirect/src/wfd_ug_genlist.c index 0a6a44f..88751ba 100755 --- a/ug-wifidirect/src/wfd_ug_genlist.c +++ b/ug-wifidirect/src/wfd_ug_genlist.c @@ -609,12 +609,12 @@ char* ConvertRGBAtoHex(int r, int g, int b, int a) { int hexcolor = 0; char *string = NULL; - string = g_try_malloc0(sizeof(char )* 255); + string = g_try_malloc0(MAX_HEX_COLOR_LENGTH); if (string == NULL) { return string; } hexcolor = (r << 24) + (g << 16) + (b << 8) + a; - sprintf(string, "%08x", hexcolor ); + snprintf(string, MAX_HEX_COLOR_LENGTH, "%08x", hexcolor ); return string; } diff --git a/ug-wifidirect/src/wfd_ug_main_view.c b/ug-wifidirect/src/wfd_ug_main_view.c index df766a6..fbad808 100755 --- a/ug-wifidirect/src/wfd_ug_main_view.c +++ b/ug-wifidirect/src/wfd_ug_main_view.c @@ -390,7 +390,7 @@ static void _gl_peer_sel(void *data, Evas_Object *obj, void *event_info) for (iterator = ugd->raw_discovered_peer_list; iterator; iterator = iterator->next) { if(!strncmp(peer_start->mac_addr, peer->mac_addr, MAC_LENGTH)) { DBG(LOG_INFO, "Device [%s] found in genlist, but it is already lost", ((device_type_s *)iterator->data)->ssid); - sprintf(txt, "Cannot find device %s", ((device_type_s *)iterator->data)->ssid); + snprintf(txt, sizeof(txt), "Cannot find device %s", ((device_type_s *)iterator->data)->ssid); free_gl_peer(&ugd->gl_avlb_peers_start, ((device_type_s *)iterator->data)->mac_addr, &ugd->gl_available_peer_cnt); wfd_check_gl_available_peers(ugd); wfd_ug_warn_popup(ugd, txt, POPUP_TYPE_INFO);