From: Kyle Russell Date: Mon, 16 May 2016 14:41:30 +0000 (-0500) Subject: vconsole-setup: Store fonts on heap (#3268) X-Git-Tag: v230~43 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a08e1b0cdef80f165a74bfff469c4660a9fb3f6;p=thirdparty%2Fsystemd.git vconsole-setup: Store fonts on heap (#3268) More friendly to the stack. --- diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c index 8a1b824e65d..08ae4aad275 100644 --- a/src/vconsole/vconsole-setup.c +++ b/src/vconsole/vconsole-setup.c @@ -195,9 +195,15 @@ static void font_copy_to_all_vcs(int fd) { unsigned char map8[E_TABSZ]; unsigned short map16[E_TABSZ]; struct unimapdesc unimapd; - struct unipair unipairs[USHRT_MAX]; + _cleanup_free_ struct unipair* unipairs = NULL; int i, r; + unipairs = new(struct unipair, USHRT_MAX); + if (unipairs == NULL) { + log_error("Not enough memory to copy fonts"); + return; + } + /* get active, and 16 bit mask of used VT numbers */ r = ioctl(fd, VT_GETSTATE, &vcs); if (r < 0) {