From 44ff5e4e6c92e81829f1adb3383d8eb788ba42c6 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 23 Nov 2022 23:21:15 +0200 Subject: [PATCH] Zero terminate temp buffers before calling strcat. --- test/pdf-operators-text.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/pdf-operators-text.c b/test/pdf-operators-text.c index 556b9d7d8..6d654d115 100644 --- a/test/pdf-operators-text.c +++ b/test/pdf-operators-text.c @@ -127,6 +127,7 @@ draw (cairo_t *cr, int width, int height) cairo_set_font_size (cr, FONT_SIZE); text = malloc (strlen(WORD) * NUM_WORDS + 1); + text[0] = '\0'; for (i = 0; i < NUM_WORDS; i++) strcat (text, WORD);