- new_value= (char *)realloc(string->string,
- sizeof(char) * ((adjust * string->block_size) + string->current_size));
+ new_size= sizeof(char) * (size_t)((adjust * string->block_size) + string->current_size);
+ /* Test for overflow */
+ if (new_size < need)
+ return MEMCACHED_MEMORY_ALLOCATION_FAILURE;
+
+ new_value= (char *)realloc(string->string, new_size);