http://corp.galois.com/blog/2014/4/9/heartbleed-a-great-time-to-think-about-incident-response.html

BTW I am always very careful when I use memcpy .. .hate that function ... read "buffer overrun" big time .....