From e9ed7bb95a9ff40b3a18d046125a3280276548b0 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 9cc77d50906a51..08703fcf542a4b 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,