mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 21:28:55 +00:00
Bug 1606721 - Fix crash on screen reader text requests with bogus offsets, r=Jamie
Differential Revision: https://phabricator.services.mozilla.com/D82424
This commit is contained in:
parent
08cdd6ddc7
commit
667bd111f3
@ -122,6 +122,12 @@ gchar* NewATKString(AccessibleOrProxy* aAccessible, gint aStartOffset,
|
||||
gint(aAccessible->CharacterCount()));
|
||||
nsAutoString str;
|
||||
aAccessible->TextSubstring(startOffset, endOffset, str);
|
||||
|
||||
if (str.Length() == 0) {
|
||||
// Bogus offsets, or empty string, either way we do not need conversion.
|
||||
return g_strdup("");
|
||||
}
|
||||
|
||||
if (aFlags & AtkStringConvertFlags::ConvertTextToAsterisks)
|
||||
ConvertTexttoAsterisks(str);
|
||||
return converter.ConvertAdjusted(str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user