Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit812b4e8

Browse files
committed
loader: return if sketch_buf could not be allocated
Without the return statement on alloc failure 'flash_area_read'gets an uninitialized pointer.
1 parent49cab77 commit812b4e8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎loader/main.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,7 @@ static int loader(const struct shell *sh) {
244244

245245
if (!sketch_buf) {
246246
printk("Unable to allocate %d bytes\n",sketch_buf_len);
247+
return-ENOMEM;
247248
}
248249

249250
rc=flash_area_read(fa,0,sketch_buf,sketch_buf_len);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp