summaryrefslogtreecommitdiff
path: root/src/node_http_parser.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-02-14 22:25:57 +0100
committerAnna Henningsen <anna@addaleax.net>2020-02-18 02:50:02 +0100
commitfab3eff2e53eb9bfbb890e5ac45523ae68ae95e5 (patch)
tree9204855c5156af4488f9c95af2cf73099b1c1b0e /src/node_http_parser.cc
parenteb0ade10a7af855ecdaa822dea028d661664cd43 (diff)
downloadnode-new-fab3eff2e53eb9bfbb890e5ac45523ae68ae95e5.tar.gz
src: inform callback scopes about exceptions in HTTP parser
Refs: https://github.com/nodejs/node/commit/4aca277f16b8649b5fc21d41f340fad0a47c2e61 Refs: https://github.com/nodejs/node/pull/30236 Fixes: https://github.com/nodejs/node/issues/31796 PR-URL: https://github.com/nodejs/node/pull/31801 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/node_http_parser.cc')
-rw-r--r--src/node_http_parser.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_http_parser.cc b/src/node_http_parser.cc
index a8c48999c5..40ece82b62 100644
--- a/src/node_http_parser.cc
+++ b/src/node_http_parser.cc
@@ -330,6 +330,7 @@ class Parser : public AsyncWrap, public StreamListener {
this, InternalCallbackScope::kSkipTaskQueues);
head_response = cb.As<Function>()->Call(
env()->context(), object(), arraysize(argv), argv);
+ if (head_response.IsEmpty()) callback_scope.MarkAsFailed();
}
int64_t val;
@@ -401,6 +402,7 @@ class Parser : public AsyncWrap, public StreamListener {
InternalCallbackScope callback_scope(
this, InternalCallbackScope::kSkipTaskQueues);
r = cb.As<Function>()->Call(env()->context(), object(), 0, nullptr);
+ if (r.IsEmpty()) callback_scope.MarkAsFailed();
}
if (r.IsEmpty()) {