mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1196391, part 3 - Make argument count assertions fatal in js::ExpandErrorArgumentsVA(). r=Waldo
This commit is contained in:
parent
5a58e1556c
commit
1da8beb1bb
@ -584,7 +584,7 @@ js::ExpandErrorArgumentsVA(ExclusiveContext* cx, JSErrorCallback callback,
|
||||
size_t totalArgsLength = 0;
|
||||
size_t argLengths[JS::MaxNumErrorArguments]; /* only {0} thru {9} supported */
|
||||
argCount = efs->argCount;
|
||||
MOZ_ASSERT(argCount <= JS::MaxNumErrorArguments);
|
||||
MOZ_RELEASE_ASSERT(argCount <= JS::MaxNumErrorArguments);
|
||||
if (argCount > 0) {
|
||||
/*
|
||||
* Gather the arguments into an array, and accumulate
|
||||
@ -651,7 +651,7 @@ js::ExpandErrorArgumentsVA(ExclusiveContext* cx, JSErrorCallback callback,
|
||||
if (*fmt == '{') {
|
||||
if (isdigit(fmt[1])) {
|
||||
int d = JS7_UNDEC(fmt[1]);
|
||||
MOZ_ASSERT(d < argCount);
|
||||
MOZ_RELEASE_ASSERT(d < argCount);
|
||||
js_strncpy(out, reportp->messageArgs[d],
|
||||
argLengths[d]);
|
||||
out += argLengths[d];
|
||||
|
Loading…
Reference in New Issue
Block a user