diff options
-rw-r--r-- | src/lib/tls/tortls_nss.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/tls/tortls_nss.c b/src/lib/tls/tortls_nss.c index b1007c6218..392747e930 100644 --- a/src/lib/tls/tortls_nss.c +++ b/src/lib/tls/tortls_nss.c @@ -588,6 +588,10 @@ tor_tls_write(tor_tls_t *tls, const char *cp, size_t n) tor_assert(cp || n == 0); tor_assert(n < INT_MAX); + if (n == 0) { + return 0; + } + PRInt32 rv = PR_Write(tls->ssl, cp, (int)n); // log_debug(LD_NET, "PR_Write(%zu) returned %d", n, (int)rv); if (rv > 0) { |