Fix length checks for signed vs unsigned
diff --git a/common/src/jni/main/cpp/NativeCrypto.cpp b/common/src/jni/main/cpp/NativeCrypto.cpp
index a18ae5c..b8ca3c3 100644
--- a/common/src/jni/main/cpp/NativeCrypto.cpp
+++ b/common/src/jni/main/cpp/NativeCrypto.cpp
@@ -8599,7 +8599,7 @@
     if (bio == nullptr) {
         return -1;
     }
-    if (BIO_ctrl_get_write_guarantee(bio) < len) {
+    if (len < 0 || BIO_ctrl_get_write_guarantee(bio) < static_cast<size_t>(len)) {
         // The network BIO couldn't handle the entire write. Don't write anything, so that we
         // only process one packet at a time.
         return 0;
@@ -8652,7 +8652,7 @@
     if (bio == nullptr) {
         return -1;
     }
-    if (BIO_ctrl_get_write_guarantee(bio) < sourceLength) {
+    if (sourceLength < 0 || BIO_ctrl_get_write_guarantee(bio) < static_cast<size_t>(sourceLength)) {
         // The network BIO couldn't handle the entire write. Don't write anything, so that we
         // only process one packet at a time.
         return 0;