MFS_Create_directory_entry Edge Case bug

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

MFS_Create_directory_entry Edge Case bug

1,210件の閲覧回数
leifzars
Contributor IV

With out the following patch the call MFS_Extend_chain returning null is not handled, and if null (due to corrupted FAT) will causes hard faults.

diff --git a/mfs/Sources/generic/mfs_dir_entry.c b/mfs/Sources/generic/mfs_dir_entry.c
index fed539f..e715003 100644
--- a/mfs/Sources/generic/mfs_dir_entry.c
+++ b/mfs/Sources/generic/mfs_dir_entry.c
@@ -348,6 +348,8 @@
{
return (NULL);
}
+ }else{
+ return NULL;
}
}
}

ラベル(1)
タグ(3)
0 件の賞賛
7 返答(返信)

837件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

HI Leif:

Thank you for your feedback. Could you let us know your MQX version, and which patch?

Regards

Daniel

0 件の賞賛

837件の閲覧回数
leifzars
Contributor IV

Version: 4.2.0.2

0 件の賞賛

837件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Hi Leif Zars

I do not find any difference in mfs_dir_entry.c between MQX 4.2.0 and patch MQX 4.2.0.2. Are you comparing the two versions?  I compared MQX 4.1 and 4.2,  they are different, but sees not your mentioned. How can I  reproduce your issue in my side. Thanks

pastedImage_1.png

Regards

Daniel

0 件の賞賛

837件の閲覧回数
leifzars
Contributor IV

Adding the highlighted section of code fixes the issue, otherwise an error returned from MFS_Extend_chain will cause a crash .

Untitled.png

0 件の賞賛

837件の閲覧回数
danielchen
NXP TechSupport
NXP TechSupport

Thanks , I will discuss this issue with the developers and hope they can merge this fix in mqx v5 version.

Regards

Daniel

0 件の賞賛

837件の閲覧回数
leifzars
Contributor IV

Good deal, thanks

0 件の賞賛

837件の閲覧回数
craig_honegger_
Senior Contributor I

This has been fixed in MQX v5 and will be available in the next release.

Thanks for reporting the issue.

0 件の賞賛