snaga/pqc — Issue #1: Large cached dataset causes segfault
Author: winamp
Created: 2011-10-12 16:06:07+00:00
State: open

Hi!

I have found an issue when getting a large dataset from memcached.
During debug it shows:

2011-10-12 17:40:26 DEBUG: pid 20632: pqc_get_cache: Query=SELECT oid FROM favorites WHERE uid=2 AND type='post' OR type='comment'
2011-10-12 17:40:26 DEBUG: pid 20632: dump_cache_data: len = 4469040

2011-10-12 17:40:26 DEBUG: pid 20599: reap_handler called
2011-10-12 17:40:26 DEBUG: pid 20599: child 20632 exits with status 11 by signal 11

I think the problem is in pqc_get_cache function. It returns a result into a 'buf' without checking its size. I'm not good at C to try to fix it