mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Check for an empty string before dereferencing the first character of the string. No bug, rs=till
--HG-- extra : rebase_source : e4b408f772aa2460db920871086faa37c04356bb
This commit is contained in:
parent
4ff31eefe1
commit
71e5708f15
@ -223,7 +223,7 @@ IdToTypeId(jsid id)
|
||||
if (JSID_IS_STRING(id)) {
|
||||
JSFlatString *str = JSID_TO_FLAT_STRING(id);
|
||||
JS::TwoByteChars cp = str->range();
|
||||
if (JS7_ISDEC(cp[0]) || cp[0] == '-') {
|
||||
if (cp.length() > 0 && (JS7_ISDEC(cp[0]) || cp[0] == '-')) {
|
||||
for (size_t i = 1; i < cp.length(); ++i) {
|
||||
if (!JS7_ISDEC(cp[i]))
|
||||
return id;
|
||||
|
Loading…
Reference in New Issue
Block a user