summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRadoslaw Czerski <r.czerski@samsung.com>2016-04-12 17:33:54 +0200
committerRadoslaw Czerski <r.czerski@samsung.com>2016-04-12 17:33:54 +0200
commitbb0089dcaecdd90dfee4493fe91386f843593809 (patch)
tree325ec37c0eb2b478a1bc6fccac49e1b13826a741
parentd221f284155b2dd353dcf33876bc9396c09bec1c (diff)
downloadindicator-win-bb0089dcaecdd90dfee4493fe91386f843593809.tar.gz
indicator-win-bb0089dcaecdd90dfee4493fe91386f843593809.tar.bz2
indicator-win-bb0089dcaecdd90dfee4493fe91386f843593809.zip
main: Use of vulnerable function fixed.
sprintf -> snprintf Change-Id: Iaaa2ae7da5d78f9500af57d82a032c3603355800 Signed-off-by: Radoslaw Czerski <r.czerski@samsung.com>
-rw-r--r--src/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index f925d7c..a9af64f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -136,6 +136,7 @@ static void _indicator_window_delete_cb(void *data, Evas_Object * obj, void *eve
_terminate_indicator((struct appdata *)data);
}
+#define SIGNAL_NAME_LEN 30
static void _indicator_notify_pm_state_cb(device_callback_e type, void *value, void *user_data)
{
static int nMove = 0;
@@ -163,9 +164,10 @@ static void _indicator_notify_pm_state_cb(device_callback_e type, void *value, v
else if(nMove<=0)
nIndex = 1;
{
- char temp[30] = {0,};
- sprintf(temp,"indicator.padding.resize.%d",nMove);
- util_signal_emit(user_data,temp,"indicator.prog");
+ char signal_to_emit[SIGNAL_NAME_LEN] = {0,};
+
+ snprintf(signal_to_emit, SIGNAL_NAME_LEN, "indicator.padding.resize.%d", nMove);
+ util_signal_emit(user_data, signal_to_emit, "indicator.prog");
}
icon_set_update_flag(0);
box_noti_ani_handle(0);