Commit 8cff69c
fsck.f2fs: fix to use strncmp to avoid out-of-boundary access
Otherwise, if length of main device path is equal to MAX_PATH_LEN,
it will trigger assert() as below:
[ASSERT] (init_sb_info:1264) !strcmp((char *)sb->devs[i].path, (char *)c.devices[i].path)
This is because there is no null character in the end of devcie
path string, result in out-of-boundary access in devs.path[].
Let's use strncmp instead of strcmp to compare device path to fix
this issue.
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>1 parent 47ad82e commit 8cff69c
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1261 | 1261 | | |
1262 | 1262 | | |
1263 | 1263 | | |
1264 | | - | |
1265 | | - | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
1266 | 1267 | | |
1267 | 1268 | | |
1268 | 1269 | | |
| |||
0 commit comments