From 6852ee197af0a3887c458a6d1bac58764b1d691b Mon Sep 17 00:00:00 2001 From: Brian Aker Date: Fri, 27 Apr 2012 20:16:05 -0700 Subject: [PATCH] Fix SASL. --- libmemcached/response.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libmemcached/response.cc b/libmemcached/response.cc index 4ba85648..809d5b6f 100644 --- a/libmemcached/response.cc +++ b/libmemcached/response.cc @@ -584,6 +584,21 @@ static memcached_return_t binary_read_one_response(memcached_server_write_instan break; case PROTOCOL_BINARY_CMD_SASL_LIST_MECHS: + { + if (header.response.keylen != 0 || bodylen + 1 > buffer_length) + { + return MEMCACHED_UNKNOWN_READ_FAILURE; + } + else + { + if ((rc= memcached_safe_read(instance, buffer, bodylen)) != MEMCACHED_SUCCESS) + { + return MEMCACHED_UNKNOWN_READ_FAILURE; + } + } + } + break; + case PROTOCOL_BINARY_CMD_VERSION: { char version_buffer[32]; // @todo document this number -- 2.30.2