memcached_clone of SASL connection closes random file descriptor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libmemcached |
New
|
Undecided
|
Unassigned |
Bug Description
memcached_clone(0, connection_
internally calls
memcached_create
that does not initialise fd field.
later SASL data fields are cloned.
that sets BINARY behaviour.
setting that behaviour tries to close existing connection (that was NOT yet made in this use-case):
memcached_
case MEMCACHED_
send_quit(ptr); // We need t shutdown all of the connections to make sure we do the correct protocol
since fd is not initialised, send_quit goes along some random fd number that happen to be in memory that was malloced during memcached_create.
trivial solution:
add
self->fd= INVALID_SOCKET;
_memcached_init in libmemcached/
hmm. too fast.
uninitialized = true.
solution = wrong.
thinking....