anandlukade / memcached

Automatically exported from code.google.com/p/memcached
0 stars 0 forks source link

in debug mode cache will cause object's destructor to misbehavior #385

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Code Analysis

What is the expected output? What do you see instead?
In debug mode, this Bug will cause destructor to misbehavior.

What version of the product are you using? On what operating system?
memcached-1.4.21

Please provide any additional information below.
File: cache.c
Line: 140
Explanation:
if (cache->destructor) {
    cache->destructor(ptr, NULL);
}
shoud be
if (cache->destructor) {
    cache->destructor(get_object(ptr), NULL);
}
in debug mode, the object pointer will be ptr + 1.

Original issue reported on code.google.com by rolandxw...@gmail.com on 21 Nov 2014 at 5:48