mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-06 10:10:52 +02:00
check return value of fwrite in test case
This commit is contained in:
+4
-1
@@ -33583,7 +33583,10 @@ static int test_lms_write_key(const byte* priv, word32 privSz, void* context)
|
||||
FILE* f = fopen((const char*)context, "wb");
|
||||
if (f == NULL)
|
||||
return -1;
|
||||
fwrite(priv, 1, privSz, f);
|
||||
if (fwrite(priv, 1, privSz, f) != privSz) {
|
||||
fclose(f);
|
||||
return -1;
|
||||
}
|
||||
fclose(f);
|
||||
return WC_LMS_RC_SAVED_TO_NV_MEMORY;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user