Commit 46a5707d9c2eefa23e88f7c63999adb9190c5b46
Committed by
Tom Rini
1 parent
8b9cc866c1
Exists in
v2017.01-smarct4x
and in
40 other branches
ext4: correctly zero filename
Since ALLOC_CACHE_ALIGN_BUFFER declares a char* for filename sizeof(filename) is not the size of the buffer. Use the already known length instead. cc: Uma Shankar <uma.shankar@samsung.com> cc: Manjunatha C Achar <a.manjunatha@samsung.com> cc: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl> Acked-by: Marek Vasut <marex@denx.de>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
fs/ext4/ext4_write.c
... | ... | @@ -840,7 +840,7 @@ |
840 | 840 | unsigned int ibmap_idx; |
841 | 841 | struct ext_filesystem *fs = get_fs(); |
842 | 842 | ALLOC_CACHE_ALIGN_BUFFER(char, filename, 256); |
843 | - memset(filename, 0x00, sizeof(filename)); | |
843 | + memset(filename, 0x00, 256); | |
844 | 844 | |
845 | 845 | g_parent_inode = zalloc(sizeof(struct ext2_inode)); |
846 | 846 | if (!g_parent_inode) |