summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Russell <bkylerussell@gmail.com>2016-05-16 09:41:30 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-05-16 10:41:30 -0400
commit6a08e1b0cdef80f165a74bfff469c4660a9fb3f6 (patch)
tree37a2af2473129acba2e609e47bad2f9eb98253ab
parent7656702318f0098f3ff727382baa48343e77d2f9 (diff)
vconsole-setup: Store fonts on heap (#3268)
More friendly to the stack.
-rw-r--r--src/vconsole/vconsole-setup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 8a1b824e65..08ae4aad27 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) {