From 27ca5260151b7d885a4267f3fc3f096770d92d2c Mon Sep 17 00:00:00 2001 From: Paolo Insogna Date: Tue, 16 Apr 2024 12:59:07 +0200 Subject: [PATCH] dns: fixed compilation warning --- src/cares_wrap.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 9cc77d50906a51a..08703fcf542a4bf 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -1601,7 +1601,10 @@ void GetAddrInfo(const FunctionCallbackInfo& args) { } Local order; - args[4]->ToUint32(env->context()).ToLocal(&order); + if (!args[4]->ToUint32(env->context()).ToLocal(&order)) { + THROW_ERR_INVALID_ARG_VALUE(env, "bad order"); + return; + } auto req_wrap = std::make_unique(env, req_wrap_obj,