зеркало из https://github.com/mozilla/gecko-dev.git
bug 1203861 - use strncmp() instead of nsCString.equals() to compare names r=davidb
AtkObject stores the name as a C string, but nsCString can store strings with '\0' in the middle. That means that if we compute a name containing '\0' nsCString.equals() will nevr consider that string to be equal to AtkObject::name, however we only want to compare up to the first '\0' because that is the only part Atk will ever see. So we should use strncmp() instead of nsCString.equals().
This commit is contained in:
Родитель
f2bc2e331e
Коммит
7b1bfa7b97
|
@ -597,7 +597,8 @@ static void
|
|||
MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName)
|
||||
{
|
||||
NS_ConvertUTF16toUTF8 newNameUTF8(aNewName);
|
||||
if (aAtkObj->name && newNameUTF8.Equals(aAtkObj->name))
|
||||
if (aAtkObj->name &&
|
||||
!strncmp(aAtkObj->name, newNameUTF8.get(), newNameUTF8.Length()))
|
||||
return;
|
||||
|
||||
// Below we duplicate the functionality of atk_object_set_name(),
|
||||
|
|
Загрузка…
Ссылка в новой задаче