Welcome! Log In Create A New Profile

Advanced

[njs] Fixed used of uninitialized memory in String.prototype.match().

Alexander Borisov
July 11, 2019 08:44AM
details: https://hg.nginx.org/njs/rev/b5f72739c00e
branches:
changeset: 1040:b5f72739c00e
user: Alexander Borisov <alexander.borisov@nginx.com>
date: Thu Jul 11 15:42:33 2019 +0300
description:
Fixed used of uninitialized memory in String.prototype.match().

diffstat:

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

diffs (20 lines):

diff -r b4e326104195 -r b5f72739c00e njs/njs_string.c
--- a/njs/njs_string.c Thu Jul 11 15:33:40 2019 +0300
+++ b/njs/njs_string.c Thu Jul 11 15:42:33 2019 +0300
@@ -2734,8 +2734,14 @@ njs_string_match_multiple(njs_vm_t *vm,
start = p + captures[0];

if (captures[1] == 0) {
- p = nxt_utf8_next(start, end);
- string.size = end - p;
+ if (start < end) {
+ p = nxt_utf8_next(start, end);
+ string.size = end - p;
+
+ } else {
+ /* To exit the loop. */
+ p++;
+ }

size = 0;
length = 0;
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fixed used of uninitialized memory in String.prototype.match().

Alexander Borisov 229 July 11, 2019 08:44AM



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

Online Users

Guests: 290
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