]> git.kaiwu.me - njs.git/commitdiff
Added error handling for NJS_VMCODE_FUNCTION_COPY instruction.
authorDmitry Volyntsev <xeioex@nginx.com>
Fri, 2 Sep 2022 00:49:06 +0000 (17:49 -0700)
committerDmitry Volyntsev <xeioex@nginx.com>
Fri, 2 Sep 2022 00:49:06 +0000 (17:49 -0700)
This closes #572 issue on Github.

src/njs_vmcode.c

index 84b8b92315afce09960aaee1230c34e70a811b86..ce071db1211d74e3d125ce7d4adf3e11fbf1269f 100644 (file)
@@ -742,6 +742,10 @@ next:
                 fcopy = (njs_vmcode_function_copy_t *) pc;
                 ret = njs_vmcode_function_copy(vm, fcopy->function,
                                                fcopy->retval);
+                if (njs_slow_path(ret != NJS_OK)) {
+                    goto error;
+                }
+
                 break;
 
             case NJS_VMCODE_FUNCTION_FRAME: