From: Dmitry Volyntsev Date: Thu, 2 Oct 2025 03:10:43 +0000 (-0700) Subject: Fixed potential heap-use-after-free in njs_vm_compile_module(). X-Git-Tag: 0.9.3~4 X-Git-Url: http://www.kaiwu.me/postgresql/commit/static/gitweb.js?a=commitdiff_plain;h=ce68e397bb613d9c33906e169f4e4304ae9e5c78;p=njs.git Fixed potential heap-use-after-free in njs_vm_compile_module(). Passing a local copy of name argument to njs_parser_init(). --- diff --git a/src/njs_vm.c b/src/njs_vm.c index 19c50e48..4b4a881a 100644 --- a/src/njs_vm.c +++ b/src/njs_vm.c @@ -327,7 +327,7 @@ njs_vm_compile_module(njs_vm_t *vm, njs_str_t *name, u_char **start, return NULL; } - ret = njs_parser_init(vm, &parser, NULL, name, *start, end); + ret = njs_parser_init(vm, &parser, NULL, &module->name, *start, end); if (njs_slow_path(ret != NJS_OK)) { return NULL; }