Check for invalid value when determinng min/max on server compatibility.
authorBrian Aker <brian@tangent.org>
Thu, 10 Feb 2011 23:20:54 +0000 (15:20 -0800)
committerBrian Aker <brian@tangent.org>
Thu, 10 Feb 2011 23:20:54 +0000 (15:20 -0800)
libmemcached/util/version.c

index bf9d0c6c201d8ac5f0f3ae63f7b5d55c4924322a..a4d5b2d431b2c50fd629112af4b48394cda550f7 100644 (file)
@@ -29,7 +29,8 @@ static memcached_return_t check_server_version(const memcached_st *ptr __attribu
   /* Do Nothing */
   struct local_context *check= (struct local_context *)context;
 
   /* Do Nothing */
   struct local_context *check= (struct local_context *)context;
 
-  if (instance->major_version >= check->major_version &&
+  if (instance->major_version != UINT8_MAX &&
+      instance->major_version >= check->major_version &&
       instance->minor_version >= check->minor_version &&
       instance->micro_version >= check->micro_version )
   {
       instance->minor_version >= check->minor_version &&
       instance->micro_version >= check->micro_version )
   {