(pop3d_readline): Bugfix: add terminating zero, and check return value from gnutls_record_recv.
Showing
1 changed file
with
9 additions
and
1 deletions
... | @@ -223,7 +223,15 @@ pop3d_readline (char *buffer, size_t size) | ... | @@ -223,7 +223,15 @@ pop3d_readline (char *buffer, size_t size) |
223 | #ifdef WITH_TLS | 223 | #ifdef WITH_TLS |
224 | if (tls_done) | 224 | if (tls_done) |
225 | { | 225 | { |
226 | gnutls_record_recv (sfile, buffer, size - 1); | 226 | int rc = gnutls_record_recv (sfile, buffer, size - 1); |
227 | if (rc < 0) | ||
228 | { | ||
229 | syslog (LOG_ERR, _("TLS error on read: %s"), | ||
230 | gnutls_strerror (rc)); | ||
231 | pop3d_abquit (ERR_TLS_IO); | ||
232 | } | ||
233 | else | ||
234 | buffer[rc] = 0; | ||
227 | ptr = buffer; | 235 | ptr = buffer; |
228 | } | 236 | } |
229 | else | 237 | else | ... | ... |
-
Please register or sign in to post a comment