Welcome! Log In Create A New Profile

Advanced

[njs] Simplified check for array length limit in njs_array_expand().

Valentin Bartenev
May 08, 2019 06:22PM
details: https://hg.nginx.org/njs/rev/cb9cbb358a8b
branches:
changeset: 959:cb9cbb358a8b
user: Valentin Bartenev <vbart@nginx.com>
date: Wed May 08 19:09:10 2019 +0300
description:
Simplified check for array length limit in njs_array_expand().

No functional changes.

diffstat:

njs/njs_array.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r 4ed09499a560 -r cb9cbb358a8b njs/njs_array.c
--- a/njs/njs_array.c Wed May 08 19:09:10 2019 +0300
+++ b/njs/njs_array.c Wed May 08 19:09:10 2019 +0300
@@ -230,7 +230,7 @@ njs_array_expand(njs_vm_t *vm, njs_array
size += size / 2;
}

- if (nxt_slow_path(((prepend + size) * sizeof(njs_value_t)) >= UINT32_MAX)) {
+ if (nxt_slow_path((prepend + size) > NJS_ARRAY_MAX_LENGTH)) {
goto memory_error;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Simplified check for array length limit in njs_array_expand().

Valentin Bartenev 282 May 08, 2019 06:22PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 261
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready