memcached_stat_free() invalid read when 0 servers

Bug #581030 reported by Teddy Grenman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libmemcached
Fix Released
Undecided
Unassigned

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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.