ui: fix vc_chr_write call in text_console_do_init
commit185951817dede3dfe4eb1c4c6d262607bee605ef
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 1 Jul 2020 18:18:01 +0000 (1 20:18 +0200)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 13 Jul 2020 09:46:35 +0000 (13 11:46 +0200)
treea5512035068cf08c2f731c44a63cf1da29e1dbf8
parent480324ec8d76582fa1c367cc9a0fdb653d4ea96e
ui: fix vc_chr_write call in text_console_do_init

In case the string doesn't fit into the buffer snprintf returns the size
it would need, so len can be larger than the buffer.  Fix this by simply
using g_strdup_printf() instead of a static buffer.

Reported-by: Wenxiang Qian <leonwxqian@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 20200701181801.27935-1-kraxel@redhat.com
ui/console.c