* Furi HAL: memory protection unit
* Core: prohibit NULL dereferencing, even for reads.
* Applications: fix NULL dereference
* Core: stack protection by MPU
* MPU: stack region alignment
* Apps: fix null pointer dereferences
* Threads: fix non-null arg check
* Desktop settings: fix null pointer dereference
* Core: documented null-check hack
* Fix null dereference issues
* Apps: args check
* Core: naming fixes
* format code
* Core: remove NONNULL specifier
* FurHal: move MPU initialization to begining, fix enum naming

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
SG
2022-08-04 01:47:10 +10:00
committed by GitHub
parent 4a6477aaa8
commit eed4296890
29 changed files with 238 additions and 62 deletions

View File

@@ -420,10 +420,12 @@ static void
mu_check(result_msg_file->size == expected_msg_file->size);
mu_check(result_msg_file->type == expected_msg_file->type);
mu_check(!result_msg_file->data == !expected_msg_file->data);
mu_check(result_msg_file->data->size == expected_msg_file->data->size);
for(int i = 0; i < result_msg_file->data->size; ++i) {
mu_check(result_msg_file->data->bytes[i] == expected_msg_file->data->bytes[i]);
if(result_msg_file->data && result_msg_file->type != PB_Storage_File_FileType_DIR) {
mu_check(!result_msg_file->data == !expected_msg_file->data); // Zlo: WTF???
mu_check(result_msg_file->data->size == expected_msg_file->data->size);
for(int i = 0; i < result_msg_file->data->size; ++i) {
mu_check(result_msg_file->data->bytes[i] == expected_msg_file->data->bytes[i]);
}
}
}
@@ -1346,8 +1348,7 @@ static void test_rpc_storage_rename_run(
}
MU_TEST(test_storage_rename) {
test_rpc_storage_rename_run(
NULL, NULL, ++command_id, PB_CommandStatus_ERROR_STORAGE_INVALID_NAME);
test_rpc_storage_rename_run("", "", ++command_id, PB_CommandStatus_ERROR_STORAGE_INVALID_NAME);
furi_check(!test_is_exists(TEST_DIR "empty.txt"));
test_create_file(TEST_DIR "empty.txt", 0);