- send_length= (size_t) snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
- "stats cachedump %u 0 0\r\n", x);
+ int send_length;
+ send_length= snprintf(buffer, MEMCACHED_DEFAULT_COMMAND_SIZE,
+ "stats cachedump %u 0 0\r\n", x);
+
+ if (send_length >= MEMCACHED_DEFAULT_COMMAND_SIZE || send_length < 0)
+ {
+ return MEMCACHED_FAILURE;
+ }