Welcome! Log In Create A New Profile

Advanced

[njs] Fixed potential NULL-pointer dereference (CID 1464584).

Dmitry Volyntsev
July 07, 2020 08:26AM
details: https://hg.nginx.org/njs/rev/7a8e3f0d52a6
branches:
changeset: 1453:7a8e3f0d52a6
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Tue Jul 07 12:23:42 2020 +0000
description:
Fixed potential NULL-pointer dereference (CID 1464584).

diffstat:

src/njs_generator.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r 29ff89055e29 -r 7a8e3f0d52a6 src/njs_generator.c
--- a/src/njs_generator.c Mon Jul 06 18:37:13 2020 +0000
+++ b/src/njs_generator.c Tue Jul 07 12:23:42 2020 +0000
@@ -571,8 +571,13 @@ njs_lookup_line(njs_vm_code_t *code, uin
njs_uint_t n;
njs_vm_line_num_t *map;

- n = (code->lines != NULL) ? code->lines->items : 0;
- map = (njs_vm_line_num_t *) code->lines->start;
+ n = 0;
+ map = NULL;
+
+ if (code->lines != NULL) {
+ n = code->lines->items;
+ map = (njs_vm_line_num_t *) code->lines->start;
+ }

while (n != 0) {
if (offset >= map->offset && (n == 1 || offset < map[1].offset)) {
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Fixed potential NULL-pointer dereference (CID 1464584).

Dmitry Volyntsev 57 July 07, 2020 08:26AM



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

Online Users

Guests: 109
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready