From: Lukasz Stanislawski Date: Mon, 17 Jul 2017 10:27:42 +0000 (+0200) Subject: ticker: perfrom additional null-check X-Git-Tag: accepted/tizen/4.0/unified/20170828.221932~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3625413929aaf50c482fd4d95f3da51088ccd936;p=profile%2Fmobile%2Fapps%2Fnative%2Findicator.git ticker: perfrom additional null-check Fix potential issue spotted by PVS-Studio static analyzer and described on https://www.viva64.com/en/b/0519/. The _ticker_view_create may call _ticker_window_create with invalid parameter. This situation cannot occur in current code since ad is always valid pointer. However function may cause crashes when some refactoring will be applied without additional null-checking of 'ad' param. Change-Id: I409ce3774390f9fa67ed26b7b9a8c34c5a7c077e --- diff --git a/src/ticker.c b/src/ticker.c index bd35b7c..4445c40 100644 --- a/src/ticker.c +++ b/src/ticker.c @@ -585,7 +585,7 @@ static void _ticker_window_destroy(void) static int _ticker_view_create(void) { - if (!ticker.win) + if (!ticker.win && ticker.ad) ticker.win = _ticker_window_create(ticker.ad); if (!ticker.layout) ticker.layout = _ticker_layout_create(ticker.win);