diff options
author | Jeroen Hofstee <jeroen@myspectrum.nl> | 2014-06-09 15:29:00 +0200 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-06-11 16:27:05 -0400 |
commit | 46a5707d9c2eefa23e88f7c63999adb9190c5b46 (patch) | |
tree | 7f2c704d8837f90d8d095dd435bfb6ffab96abb0 /fs/ext4 | |
parent | 8b9cc866c10787b057b4ac91c8783cfa752f1151 (diff) |
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>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/ext4_write.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c index c42add9a7ea..648a59672c3 100644 --- a/fs/ext4/ext4_write.c +++ b/fs/ext4/ext4_write.c @@ -840,7 +840,7 @@ int ext4fs_write(const char *fname, unsigned char *buffer, unsigned int ibmap_idx; struct ext_filesystem *fs = get_fs(); ALLOC_CACHE_ALIGN_BUFFER(char, filename, 256); - memset(filename, 0x00, sizeof(filename)); + memset(filename, 0x00, 256); g_parent_inode = zalloc(sizeof(struct ext2_inode)); if (!g_parent_inode) |