From 606f8c232b9eeb173f3de4dcdd3a8ce737ecc315 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 18 Dec 2023 08:52:00 -0500 Subject: [PATCH] ply-console-viewer: Don't crash if passed a NULL format The splash plugins currently call ply_console_viewer_print (... NULL); if no prompt message is specified... This leads to crash. Rather than fixing all the splash plugins, this commit just makes a NULL format be a noop. --- src/libply-splash-graphics/ply-console-viewer.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libply-splash-graphics/ply-console-viewer.c b/src/libply-splash-graphics/ply-console-viewer.c index 8e1ee628..dbcf3eca 100644 --- a/src/libply-splash-graphics/ply-console-viewer.c +++ b/src/libply-splash-graphics/ply-console-viewer.c @@ -341,6 +341,9 @@ ply_console_viewer_print (ply_console_viewer_t *console_viewer, char *buffer = NULL; int length; + if (format == NULL) + return; + va_start (arguments, format); length = vsnprintf (NULL, 0, format, arguments); if (length > 0)