Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions port/posix/posix_flash_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ int posixFlashFile_Read( void* c,
{
posixFlashFileContext* context = c;
if ( (context == NULL) ||
(offset + size > MAX_OFFSET(context))){
(offset > MAX_OFFSET(context)) ||
(size > MAX_OFFSET(context) - offset)){
return WH_ERROR_BADARGS;
Comment on lines 181 to 184
}

Expand All @@ -205,7 +206,8 @@ int posixFlashFile_Program(void* c,
{
posixFlashFileContext* context = c;
if ( (context == NULL) ||
(offset + size > MAX_OFFSET(context))){
(offset > MAX_OFFSET(context)) ||
(size > MAX_OFFSET(context) - offset)){
return WH_ERROR_BADARGS;
}
Comment on lines 208 to 212

Expand Down Expand Up @@ -242,7 +244,8 @@ int posixFlashFile_Verify( void* c,
uint32_t data_offset = 0;

if ( (context == NULL) ||
(offset + size > MAX_OFFSET(context))){
(offset > MAX_OFFSET(context)) ||
(size > MAX_OFFSET(context) - offset)){
return WH_ERROR_BADARGS;
}
Comment on lines 246 to 250

Expand Down Expand Up @@ -278,7 +281,8 @@ int posixFlashFile_Erase(void* c,
{
posixFlashFileContext* context = c;
if ( (context == NULL) ||
(offset + size > MAX_OFFSET(context))){
(offset > MAX_OFFSET(context)) ||
(size > MAX_OFFSET(context) - offset)){
return WH_ERROR_BADARGS;
}

Expand Down Expand Up @@ -314,7 +318,8 @@ int posixFlashFile_BlankCheck(void* c,
uint32_t this_size = 0;

if ( (context == NULL) ||
(offset + size > MAX_OFFSET(context))){
(offset > MAX_OFFSET(context)) ||
(size > MAX_OFFSET(context) - offset)){
return WH_ERROR_BADARGS;
}

Expand Down
Loading