tls: fix signed unsigned comparison 87/32387/1
authorFlorin Coras <fcoras@cisco.com>
Thu, 20 May 2021 01:33:04 +0000 (18:33 -0700)
committerFlorin Coras <fcoras@cisco.com>
Thu, 20 May 2021 01:33:29 +0000 (18:33 -0700)
On error, the signed value is cast to unsigned.

Type: fix

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I0f94422f47e40d7c358118b2df8ab96cf4116dd0

src/plugins/tlsopenssl/tls_openssl.c

index df8f167..dd0f96a 100644 (file)
@@ -181,7 +181,7 @@ openssl_read_from_ssl_into_fifo (svm_fifo_t * f, SSL * ssl)
       rv = SSL_read (ssl, fs[i].data, fs[i].len);
       read += rv > 0 ? rv : 0;
 
-      if (rv < fs[i].len)
+      if (rv < (int) fs[i].len)
        break;
     }
 
@@ -205,7 +205,7 @@ openssl_write_from_fifo_into_ssl (svm_fifo_t *f, SSL *ssl, u32 max_len)
     {
       rv = SSL_write (ssl, fs[i].data, fs[i].len);
       wrote += (rv > 0) ? rv : 0;
-      if (rv < fs[i].len)
+      if (rv < (int) fs[i].len)
        break;
       i++;
     }