From bb0089dcaecdd90dfee4493fe91386f843593809 Mon Sep 17 00:00:00 2001 From: Radoslaw Czerski Date: Tue, 12 Apr 2016 17:33:54 +0200 Subject: main: Use of vulnerable function fixed. sprintf -> snprintf Change-Id: Iaaa2ae7da5d78f9500af57d82a032c3603355800 Signed-off-by: Radoslaw Czerski --- src/main.c | 8 +++++--- 1 file 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); -- cgit v1.2.3