Commit 078026cd 078026cd916a733b72f64f54379fba4dc777525b by Sergey Poznyakoff

(pop3d_readline): Bugfix: add terminating zero, and check return value from gnutls_record_recv.

1 parent 595801aa
......@@ -223,7 +223,15 @@ pop3d_readline (char *buffer, size_t size)
#ifdef WITH_TLS
if (tls_done)
{
gnutls_record_recv (sfile, buffer, size - 1);
int rc = gnutls_record_recv (sfile, buffer, size - 1);
if (rc < 0)
{
syslog (LOG_ERR, _("TLS error on read: %s"),
gnutls_strerror (rc));
pop3d_abquit (ERR_TLS_IO);
}
else
buffer[rc] = 0;
ptr = buffer;
}
else
......