libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit 68993c4cb960f3348fab2f0f5cc96c2e7764334a
parent 55a87419ed22b0b0a1dbc3589a8123cd0592827f
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue,  3 Mar 2020 10:19:01 +0100

Call memset() to set all fontData struct fields to zero.

This prevents an uninitialized memory read found by MemorySanitizer (MSan)
when accessing fontData.isAmigaFont.

Diffstat:
Msrc/loaders/ansi.c | 1+
1 file changed, 1 insertion(+), 0 deletions(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -72,6 +72,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) const char *errstr; /* font selection */ + memset(&fontData, 0, sizeof(struct fontStruct)); select_font(&fontData, options->font); switch (options->mode) {