Index: src/orca/braille.py
===================================================================
--- src/orca/braille.py	(revision 2537)
+++ src/orca/braille.py	(working copy)
@@ -503,7 +503,7 @@
                 for i in range(0, nSelections):
                     [start, end] = text.getSelection(i)
                     maskStart = max(self.lineOffset, start) - self.lineOffset
-                    maskEnd = end - self.lineOffset
+                    maskEnd = min(end - self.lineOffset, stringLength)
                     # Combine the selection indicator with the attribute
                     # indicator.
                     #
