Fix svace & coverity issues 72/217772/1
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 14 Nov 2019 05:37:16 +0000 (14:37 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Thu, 14 Nov 2019 06:45:38 +0000 (15:45 +0900)
Change-Id: I2e03bef398add9124d6aea61a4a373736daa6c82

dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp
dali/internal/system/common/time-service.cpp
dali/internal/text/text-abstraction/font-client-plugin-impl.cpp

index 7a9d4ae..1d7be3e 100755 (executable)
@@ -650,7 +650,7 @@ bool InputMethodContextEcoreWl::RetrieveSurrounding( void* data, ImfContext* imf
         *text = strdup( plainText );
 
         // If the current input panel is password mode, dali should replace the plain text with '*' (Asterisk) character.
-        if( ecore_imf_context_input_hint_get( mIMFContext ) & ECORE_IMF_INPUT_HINT_SENSITIVE_DATA )
+        if( ( ecore_imf_context_input_hint_get( mIMFContext ) & ECORE_IMF_INPUT_HINT_SENSITIVE_DATA ) && *text )
         {
           for( char* iter = *text; *iter; ++iter )
           {
index e0b35b2..aa310b7 100644 (file)
@@ -41,10 +41,15 @@ const uint64_t NANOSECONDS_PER_SECOND = 1e+9;
 void GetNanoseconds( uint64_t& timeInNanoseconds )
 {
   timespec timeSpec;
-  clock_gettime( CLOCK_MONOTONIC, &timeSpec );
-
-  // Convert all values to uint64_t to match our return type
-  timeInNanoseconds = ( static_cast< uint64_t >( timeSpec.tv_sec ) * NANOSECONDS_PER_SECOND ) + static_cast< uint64_t >( timeSpec.tv_nsec );
+  if( clock_gettime( CLOCK_MONOTONIC, &timeSpec ) == 0 )
+  {
+    // Convert all values to uint64_t to match our return type
+    timeInNanoseconds = ( static_cast< uint64_t >( timeSpec.tv_sec ) * NANOSECONDS_PER_SECOND ) + static_cast< uint64_t >( timeSpec.tv_nsec );
+  }
+  else
+  {
+    timeInNanoseconds = 0;
+  }
 }
 
 void SleepUntil( uint64_t timeInNanoseconds )
index 8bae462..11d9087 100755 (executable)
@@ -1463,7 +1463,7 @@ void FontClient::Plugin::CreateBitmap( FontId fontId, GlyphIndex glyphIndex, boo
           {
             if( glyph->format != FT_GLYPH_FORMAT_BITMAP )
             {
-              int offsetX, offsetY;
+              int offsetX = 0, offsetY = 0;
               bool isOutlineGlyph = ( glyph->format == FT_GLYPH_FORMAT_OUTLINE && outlineWidth > 0 );
 
               // Create a bitmap for the outline