From: Taesoo Jun Date: Thu, 19 Jul 2018 01:40:40 +0000 (+0900) Subject: Fix local variable initialization and handle a invalid parameter X-Git-Tag: accepted/tizen/unified/20180725.060450~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bafd064cd4e4530782b5e4fd8e3f8cd6fb4a4284;p=platform%2Fcore%2Fconnectivity%2Fstc-manager.git Fix local variable initialization and handle a invalid parameter Change-Id: Idc99e6b41528f0429882d2bf91e4bbe0c997b05d Signed-off-by: Taesoo Jun --- diff --git a/src/monitor/stc-monitor.c b/src/monitor/stc-monitor.c index 5885fc9..3abebef 100755 --- a/src/monitor/stc-monitor.c +++ b/src/monitor/stc-monitor.c @@ -891,11 +891,11 @@ static void __action_when_rstn_limit_exceeded(stc_rstn_limit_type_e limit_type, classid_bytes_context_s *context) { gboolean rv; - char iftype[MAX_INT_LENGTH]; - char byte[MAX_INT_LENGTH]; - const char *signal_name; - const char *net_popup_content; - const char *net_popup_type; + char iftype[MAX_INT_LENGTH] = { 0, }; + char byte[MAX_INT_LENGTH] = { 0, }; + const char *signal_name = NULL; + const char *net_popup_content = NULL; + const char *net_popup_type = NULL; stc_s *stc = (stc_s *)stc_get_manager(); if (stc == NULL) { @@ -940,6 +940,11 @@ static void __action_when_rstn_limit_exceeded(stc_rstn_limit_type_e limit_type, break; } + if (signal_name == NULL) { + STC_LOGE("Invalid parameter: limit_type"); + return; + } + /* emit signal */ rv = stc_manager_dbus_emit_signal(stc->connection, STC_DBUS_SERVICE_RESTRICTION_PATH,