mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
nss: Don't write empty payload on the wire
Part of #40548 Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user