fixes and suppressions for defects reported by clang-analyzer-unix.Stream (new in llvm-19.0.0_pre20240504):
* added POSIX definitions for XFEOF(), XFERROR(), and XCLEARERR(), currently with no-op fallbacks for !POSIX. * added missing file handle checks in testsuite/testsuite.c:file_test() and tests/utils.h:copy_file(). * added fixes and suppression around tests/api.c:test_wolfSSL_SMIME_read_PKCS7(). * added various fixes in examples/asn1/asn1.c and examples/pem/pem.c.
This commit is contained in:
@@ -610,12 +610,19 @@ void file_test(const char* file, byte* check)
|
||||
return;
|
||||
}
|
||||
while( ( i = (int)fread(buf, 1, sizeof(buf), f )) > 0 ) {
|
||||
if (ferror(f)) {
|
||||
printf("I/O error reading %s\n", file);
|
||||
fclose(f);
|
||||
return;
|
||||
}
|
||||
ret = wc_Sha256Update(&sha256, buf, i);
|
||||
if (ret != 0) {
|
||||
printf("Can't wc_Sha256Update %d\n", ret);
|
||||
fclose(f);
|
||||
return;
|
||||
}
|
||||
if (feof(f))
|
||||
break;
|
||||
}
|
||||
|
||||
ret = wc_Sha256Final(&sha256, shasum);
|
||||
|
||||
Reference in New Issue
Block a user