From cbe7f2b95e88f8d5a10df7a847513ff1702b74a6 Mon Sep 17 00:00:00 2001 From: Rusty Conover Date: Sat, 25 Jan 2020 12:58:25 -0500 Subject: [PATCH] tls: Fix crash when internal debug enabled When NODE_DEBUG_NATIVE is enabled for tls a debug statement is sometimes called with error_str set to null, this causes a crash from glibc since string format parameters should not be null. --- src/tls_wrap.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index 82274fde6db0c1..ade8a60827886d 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -89,7 +89,7 @@ TLSWrap::~TLSWrap() { bool TLSWrap::InvokeQueued(int status, const char* error_str) { - Debug(this, "InvokeQueued(%d, %s)", status, error_str); + Debug(this, "InvokeQueued(%d, %s)", status, error_str ? error_str : ""); if (!write_callback_scheduled_) return false;