mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 15:23:51 +00:00
Bug 1348797 - Add null-check to validTagChars test in LocaleService::NegotiateLanguages. r=jfkthame
--HG-- extra : amend_source : f6dde0867a6cf10b5b2f50c3cfcf3f383d708d28
This commit is contained in:
parent
ebd9e78f82
commit
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"], []],
|
||||
|
Loading…
Reference in New Issue
Block a user