From 90245ebc5328b998d24b0ab9f6a91496036c3202 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 10 Aug 2018 08:19:57 +0200 Subject: fs: ramfs: get chunks zero initialized Initialize new chunks to zero, otherwise a ->truncate call may result in uninitialized data in files. Signed-off-by: Sascha Hauer --- fs/ramfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/ramfs.c b/fs/ramfs.c index a97f0a6ebf..7af885b324 100644 --- a/fs/ramfs.c +++ b/fs/ramfs.c @@ -140,7 +140,7 @@ static struct ramfs_chunk *ramfs_get_chunk(void) if (!data) return NULL; - data->data = malloc(CHUNK_SIZE); + data->data = calloc(CHUNK_SIZE, 1); if (!data->data) { free(data); return NULL; -- cgit v1.2.3