memcached_stat_free() invalid read when 0 servers

Bug #581030 reported by Teddy Grenman
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

This applies to libmemcached 0.40.

When I run memcached_stat() without any servers, stat succeeds but memcached_stat_free() crashes on invalid read in stats.c:479 (memc_stat->root). This happens because calloc does not necessarily return NULL on allocation of 0 elements. Simple fixes is to check the errno or always allocate one extra byte.

Revision history for this message
Teddy Grenman (tricky-launchpad) wrote :
Revision history for this message
Brian Aker (brianaker) wrote :

This was fixed in the current release.

Changed in libmemcached:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers