зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1348797 - Add null-check to validTagChars test in LocaleService::NegotiateLanguages. r=jfkthame
--HG-- extra : amend_source : f6dde0867a6cf10b5b2f50c3cfcf3f383d708d28
This commit is contained in:
Родитель
ebd9e78f82
Коммит
b17d737c5b
|
@ -463,7 +463,7 @@ LocaleService::NegotiateLanguages(const char** aRequested,
|
|||
// Check that the given string contains only ASCII characters valid in tags
|
||||
// (i.e. alphanumerics, plus '-' and '_'), and is non-empty.
|
||||
auto validTagChars = [](const char* s) {
|
||||
if (!*s) {
|
||||
if (!s || !*s) {
|
||||
return false;
|
||||
}
|
||||
while (*s) {
|
||||
|
|
|
@ -86,6 +86,11 @@ const data = {
|
|||
],
|
||||
"should not crash on invalid input": [
|
||||
[null, ["fr-FR"], []],
|
||||
[[null], [], []],
|
||||
[[undefined], [], []],
|
||||
[[undefined], [null], []],
|
||||
[[undefined], [undefined], []],
|
||||
[[null], [null], null, null, []],
|
||||
[undefined, ["fr-FR"], []],
|
||||
[2, ["fr-FR"], []],
|
||||
["fr-FR", ["fr-FR"], []],
|
||||
|
|
Загрузка…
Ссылка в новой задаче