Fix SASL.
authorBrian Aker <brian@tangent.org>
Sat, 28 Apr 2012 03:16:05 +0000 (20:16 -0700)
committerBrian Aker <brian@tangent.org>
Sat, 28 Apr 2012 03:16:05 +0000 (20:16 -0700)
libmemcached/response.cc

index 4ba856489f81e9a16aa121a81843dbcc537e4bf9..809d5b6fb7606793b71d06c9c60e21e47d515958 100644 (file)
@@ -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