[njs] Fixed exception throwing when RegExp match fails.

Dmitry Volyntsev xeioex at nginx.com
Mon Nov 22 13:40:55 UTC 2021


details:   https://hg.nginx.org/njs/rev/7f72930cf1ac
branches:  
changeset: 1750:7f72930cf1ac
user:      Dmitry Volyntsev <xeioex at nginx.com>
date:      Mon Nov 22 13:37:11 2021 +0000
description:
Fixed exception throwing when RegExp match fails.

The issue was introduced in a83775113025 (0.1.15).

This closes #439 issue on Github.

diffstat:

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

diffs (12 lines):

diff -r a57d9a17f702 -r 7f72930cf1ac src/njs_regexp.c
--- a/src/njs_regexp.c	Thu Nov 18 13:48:55 2021 +0000
+++ b/src/njs_regexp.c	Mon Nov 22 13:37:11 2021 +0000
@@ -446,7 +446,7 @@ njs_regexp_match_trace_handler(njs_trace
     trace = trace->next;
     p = trace->handler(trace, td, start);
 
-    njs_internal_error(vm, (const char *) start);
+    njs_internal_error(vm, "%*s", p - start, start);
 
     return p;
 }


More information about the nginx-devel mailing list