[njs] Checking that backtrace is available before accessing it.

Dmitry Volyntsev xeioex at nginx.com
Fri Nov 17 16:06:04 UTC 2017


details:   http://hg.nginx.org/njs/rev/84a95e20f93a
branches:  
changeset: 421:84a95e20f93a
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Fri Nov 17 18:55:07 2017 +0300
description:
Checking that backtrace is available before accessing it.

diffstat:

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

diffs (12 lines):

diff -r 5bc8d7c25e4f -r 84a95e20f93a njs/njscript.c
--- a/njs/njscript.c	Fri Nov 17 18:55:07 2017 +0300
+++ b/njs/njscript.c	Fri Nov 17 18:55:07 2017 +0300
@@ -533,7 +533,7 @@ njs_vm_exception(njs_vm_t *vm, nxt_str_t
 nxt_array_t *
 njs_vm_backtrace(njs_vm_t *vm)
 {
-    if (!nxt_array_is_empty(vm->backtrace)) {
+    if (vm->backtrace != NULL && !nxt_array_is_empty(vm->backtrace)) {
         return vm->backtrace;
     }
 


More information about the nginx-devel mailing list