Skip to content

Commit 8143741

Browse files
OTA: STM32H7 add check on fopen failures
Co-authored-by: Andrea Gilardoni <[email protected]>
1 parent 4edf9b4 commit 8143741

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/ota/implementation/OTASTM32H7.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ OTACloudProcessInterface::State STM32H7OTACloudProcess::startOTA() {
6262

6363
decompressed = fopen(_filename.c_str(), "wb");
6464

65+
if(decompressed == nullptr) {
66+
return ErrorOpenUpdateFileFail;
67+
}
6568
// start the download if the setup for ota storage is successful
6669
return OTADefaultCloudProcessInterface::startOTA();
6770
}

0 commit comments

Comments
 (0)