From af579907de829d7fa4ea8e6b50c8c6a8ac157dfb Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 14 Nov 2017 10:18:32 +0100 Subject: [PATCH] src: fix bad sizeof expression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It was computing the size of the pointer, not the size of the pointed-to object. Introduced in commit 727b2911eca ("src,dns: refactor cares_wrap to avoid global state".) PR-URL: https://github.com/nodejs/node/pull/17014 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Daniel Bevenius Reviewed-By: Franziska Hinkelmann Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Tobias Nießen --- src/cares_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index b90b2186959b2e..cf945cd7812d07 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -158,7 +158,7 @@ class ChannelWrap : public AsyncWrap { } inline node_ares_task_list* task_list() { return &task_list_; } - size_t self_size() const override { return sizeof(this); } + size_t self_size() const override { return sizeof(*this); } static void AresTimeout(uv_timer_t* handle);