From bc2f570bf4bd20c7ce2ead6c35d7cd7274ed1594 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Tue, 20 Nov 2012 21:33:49 +0100 Subject: [PATCH] splash: fix splash breakage Commit 3fa8d74a introduced structures screen and surface. Unfortunately, these structures are allocated on the stack, and not initialized. As a consequence, sc->offscreen might contain a random value, which is used later for memcpy operations, corrupting memory. Fix it by initializing the structures. Signed-off-by: Robert Jarzmik --- commands/splash.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/commands/splash.c b/commands/splash.c index 65dd530..b0830fb 100644 --- a/commands/splash.c +++ b/commands/splash.c @@ -49,6 +49,8 @@ static int do_splash(int argc, char *argv[]) } image_file = argv[optind]; + memset(&sc, 0, sizeof(sc)); + memset(&s, 0, sizeof(s)); fd = fb_open(fbdev, &sc, offscreen); if (fd < 0) { perror("fd_open"); -- 1.7.10.4