From 77ccbfb9a78c894be172f53dc69e191ec98cbd77 Mon Sep 17 00:00:00 2001 From: Michael Wallner Date: Wed, 16 Sep 2020 14:24:19 +0200 Subject: [PATCH] libmemcached/sasl: ensure mech list is zero terminated --- src/libmemcached/sasl.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libmemcached/sasl.cc b/src/libmemcached/sasl.cc index 89462e50..021cf3fb 100644 --- a/src/libmemcached/sasl.cc +++ b/src/libmemcached/sasl.cc @@ -173,8 +173,8 @@ memcached_return_t memcached_sasl_authenticate_connection(memcached_instance_st* memcached_server_response_increment(server); - char mech[MEMCACHED_MAX_BUFFER]; - memcached_return_t rc= memcached_response(server, mech, sizeof(mech), NULL); + char mech[MEMCACHED_MAX_BUFFER] = {0}; + memcached_return_t rc= memcached_response(server, mech, sizeof(mech) - 1, NULL); if (memcached_failed(rc)) { if (rc == MEMCACHED_PROTOCOL_ERROR) -- 2.30.2