Skip to content

Commit eca8175

Browse files
committed
Fixed bug #931.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11852 110e8d01-0319-4d1e-a829-52ad28d1bb01
1 parent c448806 commit eca8175

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

os/hal/lib/complex/mfs/mfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,7 @@ mfs_error_t mfsReadRecord(MFSDriver *mfsp, mfs_id_t id,
950950
/* Header read from flash.*/
951951
RET_ON_ERROR(mfs_flash_read(mfsp,
952952
mfsp->descriptors[id - 1U].offset,
953-
*np,
953+
sizeof (mfs_data_header_t),
954954
mfsp->buffer.data8));
955955

956956
/* Data read from flash.*/

readme.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@
110110
- EX: Updated LIS302DL to 1.1.0 (backported to 18.2.1).
111111
- EX: Updated LPS25H to 1.1.0 (backported to 18.2.1).
112112
- EX: Updated LSM303DLHC to 1.1.0 (backported to 18.2.1).
113+
- HAL: Fixed function mfsReadRecord() causes memory corruption because a
114+
buffer overflow (bug #931)(backported to 18.2.1).
113115
- HAL: Fixed invalid SAI1 clock selection on STM32F7xx (bug #929)(backported
114116
to 18.2.1 and 17.6.4).
115117
- HAL: Fixed invalid clock checks for SDMMC1 and SDMMC2 on STM32F7xx

test/mfs/configuration.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ test_assert(err == MFS_ERR_NOT_FOUND , "record was already present");]]></value>
328328
</step>
329329
<step>
330330
<description>
331-
<value>Creating the record then retrieving it again, MFS_ERR_NOT_FOUND is expected, record content and size are compared with the original.</value>
331+
<value>Creating the record then retrieving it again, MFS_NO_ERROR is expected, record content and size are compared with the original.</value>
332332
</description>
333333
<tags>
334334
<value />

test/mfs/source/test/mfs_test_sequence_001.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ static const testcase_t mfs_test_001_002 = {
222222
* <h2>Test Steps</h2>
223223
* - [1.3.1] The record must not already exists, MFS_ERR_NOT_FOUND is
224224
* expected.
225-
* - [1.3.2] Creating the record then retrieving it again,
226-
* MFS_ERR_NOT_FOUND is expected, record content and size are
227-
* compared with the original.
225+
* - [1.3.2] Creating the record then retrieving it again, MFS_NO_ERROR
226+
* is expected, record content and size are compared with the
227+
* original.
228228
* - [1.3.3] Updating the record then retrieving it again, MFS_NO_ERROR
229229
* is expected, record content and size are compared with the
230230
* original.
@@ -254,9 +254,9 @@ static void mfs_test_001_003_execute(void) {
254254
test_assert(err == MFS_ERR_NOT_FOUND , "record was already present");
255255
}
256256

257-
/* [1.3.2] Creating the record then retrieving it again,
258-
MFS_ERR_NOT_FOUND is expected, record content and size are
259-
compared with the original.*/
257+
/* [1.3.2] Creating the record then retrieving it again, MFS_NO_ERROR
258+
is expected, record content and size are compared with the
259+
original.*/
260260
test_set_step(2);
261261
{
262262
mfs_error_t err;

0 commit comments

Comments
 (0)