From: Jeroen Hofstee Date: Mon, 9 Jun 2014 13:29:00 +0000 (+0200) Subject: ext4: correctly zero filename X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=46a5707d9c2eefa23e88f7c63999adb9190c5b46;p=u-boot.git 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 cc: Manjunatha C Achar cc: Marek Vasut Signed-off-by: Jeroen Hofstee Acked-by: Marek Vasut --- diff --git a/fs/ext4/ext4_write.c b/fs/ext4/ext4_write.c index c42add9a7e..648a59672c 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)