From: Michael Wallner Date: Wed, 16 Sep 2020 12:24:19 +0000 (+0200) Subject: libmemcached/sasl: ensure mech list is zero terminated X-Git-Tag: 1.1.0-beta1~236^2~53 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=77ccbfb9a78c894be172f53dc69e191ec98cbd77;p=m6w6%2Flibmemcached libmemcached/sasl: ensure mech list is zero terminated --- 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)