Skip to content

Commit 9f4a02c

Browse files
committed
Fixed potential heap-use-after-free in njs_vm_compile_module().
Passing a local copy of name argument to njs_parser_init().
1 parent c3917e8 commit 9f4a02c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/njs_vm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ njs_vm_compile_module(njs_vm_t *vm, njs_str_t *name, u_char **start,
327327
return NULL;
328328
}
329329

330-
ret = njs_parser_init(vm, &parser, NULL, name, *start, end);
330+
ret = njs_parser_init(vm, &parser, NULL, &module->name, *start, end);
331331
if (njs_slow_path(ret != NJS_OK)) {
332332
return NULL;
333333
}

0 commit comments

Comments
 (0)