--- proftpd-1.3.0/contrib/mod_tls.c.org 2006-11-15 16:00:44.000000000 -0700 +++ proftpd-1.3.0/contrib/mod_tls.c 2006-11-15 16:02:02.000000000 -0700 @@ -2485,6 +2485,8 @@ datalen = BIO_get_mem_data(mem, &data); if (data) { + if (datalen > sizeof(buf)-1) + datalen = sizeof(buf)-1; memset(&buf, '\0', sizeof(buf)); memcpy(buf, data, datalen); buf[datalen] = '\0';