浏览代码

Fix sanitizer complaint

Andras Fekete 1 月之前
父节点
当前提交
4cb176ffff
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      wolfcrypt/test/test.c

+ 3 - 0
wolfcrypt/test/test.c

@@ -16488,6 +16488,9 @@ static wc_test_ret_t cert_load_bad(const char* fname, byte* tmp, int err)
     XFILE         file;
     size_t        bytes;
 
+    if ((fname == NULL) || (tmp == NULL)) {
+        ERROR_OUT(WC_TEST_RET_ENC_NC, done);
+    }
     file = XFOPEN(fname, "rb");
     if (!file) {
         ERROR_OUT(WC_TEST_RET_ENC_ERRNO, done);