if (access(arg_buffer.str().c_str(), X_OK) == 0)
{
- strncpy(memcached_binary_path, arg_buffer.str().c_str(), FILENAME_MAX);
+ strncpy(memcached_binary_path, arg_buffer.str().c_str(), FILENAME_MAX-1);
}
}
#endif
{
if (socket)
{
- strncpy(global_socket, socket, strlen(socket));
+ strncpy(global_socket, socket, sizeof(global_socket)-1);
}
}
for (uint32_t x= 0; x < 250; ++x)
{
- char key[250];
+ char key[251];
size_t len= (size_t)snprintf(key, sizeof(key), "%0250u", x);
memcached_return_t rc= memcached_delete(memc, key, len, 0);
char error_buffer[2048]= { 0 };
// Delete, and then delete again to look for not found
{
- char key[250];
+ char key[251];
size_t len= snprintf(key, sizeof(key), "%037u", 251U);
memcached_return_t rc= memcached_delete(memc, key, len, 0);
test_true(rc == MEMCACHED_SUCCESS or rc == MEMCACHED_BUFFERED);