MFS_Create_directory_entry Edge Case bug

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MFS_Create_directory_entry Edge Case bug

1,559 Views
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;
}
}
}

Labels (1)
Tags (3)
0 Kudos
Reply
7 Replies

1,186 Views
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 Kudos
Reply

1,186 Views
leifzars
Contributor IV

Version: 4.2.0.2

0 Kudos
Reply

1,186 Views
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 Kudos
Reply

1,186 Views
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 Kudos
Reply

1,186 Views
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 Kudos
Reply

1,186 Views
leifzars
Contributor IV

Good deal, thanks

0 Kudos
Reply

1,186 Views
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 Kudos
Reply