From 96b4683e861df67f43bffcec3d3660a1a299ea74 Mon Sep 17 00:00:00 2001 From: czapek1337 Date: Sat, 29 Oct 2022 03:32:09 +0200 Subject: [PATCH] Zero out allocated buffers before using --- backends/framebuffer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/framebuffer.c b/backends/framebuffer.c index e10f752..dfee794 100644 --- a/backends/framebuffer.c +++ b/backends/framebuffer.c @@ -891,9 +891,11 @@ struct term_context *fbterm_init( ctx->queue_size = _ctx->rows * _ctx->cols * sizeof(struct fbterm_queue_item); ctx->queue = _malloc(ctx->queue_size); ctx->queue_i = 0; + memset(ctx->queue, 0, ctx->queue_size); ctx->map_size = _ctx->rows * _ctx->cols * sizeof(struct fbterm_queue_item *); ctx->map = _malloc(ctx->map_size); + memset(ctx->map, 0, ctx->map_size); ctx->canvas_size = ctx->width * ctx->height * sizeof(uint32_t); ctx->canvas = _malloc(ctx->canvas_size);