[Fix] limited the input taken by sscanf for ip and mac address 58/47358/1 accepted/tizen/mobile/20150910.025045 accepted/tizen/tv/20150910.025059 accepted/tizen/wearable/20150910.025115 submit/tizen/20150910.011355
authorNishant Chaprana <n.chaprana@samsung.com>
Wed, 2 Sep 2015 13:10:57 +0000 (18:40 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Wed, 2 Sep 2015 13:10:57 +0000 (18:40 +0530)
Description: This patch also fixes some warinings as below:
1. assigned value of rv was over written in __ws_p2p_supplicant_start
and __ws_p2p_supplicant_stop funtions.
2. In _ws_reset_plugin the name of in variable was conflicting with
global variable g_pd, so replced g_pd in this funtion with f_pd
to differ between global and funtion param.

Change-Id: I29c231bf859736995b9c604bb7088be976406401
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/wifi-direct-manager.spec
plugin/wpasupplicant/ctrl_iface_dbus/wfd-plugin-wpasupplicant.c
src/wifi-direct-util.c

index fccbdce..f2bde3c 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          wifi-direct-manager
 Summary:       Wi-Fi Direct manger
-Version:       1.2.97
+Version:       1.2.98
 Release:       1
 Group:      Network & Connectivity/Wireless
 License:    Apache-2.0
index 7ed8a57..c3d94c2 100755 (executable)
@@ -2288,11 +2288,11 @@ int wfd_plugin_load(wfd_oem_ops_s **ops)
        return 0;
 }
 
-static int _ws_reset_plugin(ws_dbus_plugin_data_s *g_pd)
+static int _ws_reset_plugin(ws_dbus_plugin_data_s *f_pd)
 {
        __WDP_LOG_FUNC_ENTER__;
 
-       if (!g_pd) {
+       if (!f_pd) {
                WDP_LOGE("Invalid parameter");
                __WDP_LOG_FUNC_EXIT__;
                return -1;
@@ -2300,11 +2300,10 @@ static int _ws_reset_plugin(ws_dbus_plugin_data_s *g_pd)
 
        _ws_deinit_dbus_connection();
 
-       if (g_pd->activated)
-               ws_deactivate(g_pd->concurrent);
+       if (f_pd->activated)
+               ws_deactivate(f_pd->concurrent);
 
-       g_free(g_pd);
-       g_pd = NULL;
+       g_free(f_pd);
 
        __WDP_LOG_FUNC_EXIT__;
        return 0;
@@ -2537,7 +2536,7 @@ static int __ws_p2p_firmware_stop(void)
 
 static int __ws_p2p_supplicant_start(void)
 {
-       gboolean rv = FALSE;
+       gboolean rv;
        const char *path = "/usr/sbin/p2p_supp.sh";
        char *const args[] = { "/usr/sbin/p2p_supp.sh", "start_dbus", NULL };
        char *const envs[] = { NULL };
@@ -2556,7 +2555,7 @@ static int __ws_p2p_supplicant_start(void)
 
 static int __ws_p2p_supplicant_stop(void)
 {
-       gboolean rv = FALSE;
+       gboolean rv;
        const char *path = "/usr/sbin/p2p_supp.sh";
        char *const args[] = { "/usr/sbin/p2p_supp.sh", "stop", NULL };
        char *const envs[] = { NULL };
index c31c98a..e4edff3 100755 (executable)
@@ -645,7 +645,7 @@ static void _dhcps_ip_leased_cb(keynode_t *key, void* data)
 
        while(fgets(buf, MAX_DHCP_DUMP_SIZE, fp) != NULL) {
                WDS_LOGD("Read line [%s]", buf);
-               n = sscanf(buf,"%s %s", intf_str, ip_str);
+               n = sscanf(buf,"%17s %15s", intf_str, ip_str);
                WDS_LOGD("ip=[%s], mac=[%s]",ip_str, intf_str);
                if (n != 2) {
                        continue;