From: Ray Strode Date: Mon, 18 Dec 2023 13:52:00 +0000 (-0500) Subject: ply-console-viewer: Don't crash if passed a NULL format X-Git-Tag: 23.51.283~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=606f8c232b9eeb173f3de4dcdd3a8ce737ecc315;p=thirdparty%2Fplymouth.git 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. --- 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)