Skip to content

Commit

Permalink
target_flash: Prevent NULL dereference when detached from targets
Browse files Browse the repository at this point in the history
  • Loading branch information
ALTracer committed Aug 18, 2024
1 parent 992f871 commit c43c128
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/target/target_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ bool target_flash_write(target_s *target, target_addr_t dest, const void *src, s

bool target_flash_complete(target_s *target)
{
if (!target->flash_mode)
if (!target || !target->flash_mode)
return false;

bool result = true; /* Catch false returns with &= */
Expand Down

0 comments on commit c43c128

Please sign in to comment.