From: Seoyeon Kim Date: Tue, 12 Sep 2017 08:03:07 +0000 (+0900) Subject: Fix SVACE issue X-Git-Tag: dali_1.2.57~4^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F15%2F149415%2F2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Fix SVACE issue - Fix to prevent 'name' from passing a null pointer to a 'std::string', because it would result in dereferencing a null pointer. Change-Id: If01974fa77662db75480962ff52373a6cc403b17 Signed-off-by: Seoyeon Kim --- diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index 7ce455e..889b57d 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -74,7 +74,11 @@ std::string GetHorizontalAlignment( Toolkit::Text::Layout::HorizontalAlignment a HORIZONTAL_ALIGNMENT_STRING_TABLE, HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT ); - return std::string( name ); + if( name ) + { + return std::string( name ); + } + return std::string(); } std::string GetVerticalAlignment( Toolkit::Text::Layout::VerticalAlignment alignment ) @@ -83,7 +87,11 @@ std::string GetVerticalAlignment( Toolkit::Text::Layout::VerticalAlignment align VERTICAL_ALIGNMENT_STRING_TABLE, VERTICAL_ALIGNMENT_STRING_TABLE_COUNT ); - return std::string( name ); + if( name ) + { + return std::string( name ); + } + return std::string(); } const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(