From 8cd8e7d3ae07aa772f0d8c09df7ee10290259c65 Mon Sep 17 00:00:00 2001 From: Dwedit Date: Mon, 28 May 2018 10:54:25 -0500 Subject: [PATCH] Fix a calloc(0) which led to uninitialized data being used later on. --- tasks/task_content.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index 3676308d73..a3fdbefc41 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -796,8 +796,11 @@ static bool content_file_init( !content_file_init_set_attribs(content, special, content_ctx, error_string)) return false; - info = (struct retro_game_info*) - calloc(content->size, sizeof(*info)); + if (content->size > 0) + { + info = (struct retro_game_info*) + calloc(content->size, sizeof(*info)); + } if (info) {