Browse Source

scan-build warning fix

JacobBarthelmeh 1 year ago
parent
commit
1e673aee3b
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/bio.c

+ 5 - 0
src/bio.c

@@ -526,6 +526,11 @@ static int wolfSSL_BIO_MEMORY_write(WOLFSSL_BIO* bio, const void* data,
         return WOLFSSL_FAILURE;
     }
 
+    if (bio->mem_buf->data == NULL) {
+        WOLFSSL_MSG("Buffer data is NULL");
+        return WOLFSSL_FAILURE;
+    }
+
     XMEMCPY(bio->mem_buf->data + bio->wrSz, data, len);
     bio->ptr = bio->mem_buf->data;
     bio->num = (int)bio->mem_buf->max;