[Libguestfs] [PATCH nbdkit 2/2] crypto: Fix error path when sending to gnutls socket.

Richard W.M. Jones rjones at redhat.com
Thu Jun 14 13:36:29 UTC 2018


Found by Coverity.
---
 src/crypto.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/crypto.c b/src/crypto.c
index 17a667b..23c5c8f 100644
--- a/src/crypto.c
+++ b/src/crypto.c
@@ -294,7 +294,7 @@ crypto_send (struct connection *conn, const void *vbuf, size_t len)
 
   while (len > 0) {
     r = gnutls_record_send (*session, buf, len);
-    if (r == -1) {
+    if (r < 0) {
       if (r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN)
         continue;
       return -1;
-- 
2.16.2




More information about the Libguestfs mailing list