[AT-SPI] Fixed uint underflow risk
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / text-controls / text-label-impl.cpp
index 2b61ddb..3ecb376 100755 (executable)
@@ -989,6 +989,11 @@ std::string TextLabel::AccessibleImpl::GetNameRaw()
   return slf.GetProperty( Toolkit::TextLabel::Property::TEXT ).Get< std::string >();
 }
 
+Property::Index TextLabel::AccessibleImpl::GetNamePropertyIndex()
+{
+  return Toolkit::TextLabel::Property::TEXT;
+}
+
 std::string TextLabel::AccessibleImpl::GetText( size_t startOffset,
                                                 size_t endOffset )
 {
@@ -1072,7 +1077,7 @@ Dali::Accessibility::Range TextLabel::AccessibleImpl::GetTextAtOffset(
             if (boundary == Dali::Accessibility::TextBoundary::LINE)
               counter++;
           }
-          if ((counter - 1) == offset)
+          if ((counter > 0) && ((counter - 1) == offset))
           {
             range.content = txt.substr(start, index - start + 1);
             range.startOffset = start;