diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-03 20:57:37 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2016-11-03 20:57:37 +0100 |
commit | 2b288236e80938d29324072a823f46861bd07cd3 (patch) | |
tree | 5129f07bc40b6267f41c74486faad598b085f5e5 | |
parent | 1ab7c2fc6daf252f20d17949e70829905a7fd72a (diff) | |
download | busybox-2b288236e80938d29324072a823f46861bd07cd3.tar.gz |
loadfont: 32k size limit is not enough
Since our "read to malloced buf" routines only gradually grow
allocations, let's be generous here and allow 128k.
Reported by Alex Henrie <alexhenrie24@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | console-tools/loadfont.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c index 032506d6d..58073e0dc 100644 --- a/console-tools/loadfont.c +++ b/console-tools/loadfont.c @@ -319,8 +319,10 @@ int loadfont_main(int argc UNUSED_PARAM, char **argv) * We used to look at the length of the input file * with stat(); now that we accept compressed files, * just read the entire file. + * Len was 32k, but latarcyrheb-sun32.psfu is 34377 bytes + * (it has largish Unicode map). */ - len = 32*1024; // can't be larger + len = 128*1024; buffer = xmalloc_read(STDIN_FILENO, &len); // xmalloc_open_zipped_read_close(filename, &len); if (!buffer) @@ -405,7 +407,7 @@ int setfont_main(int argc UNUSED_PARAM, char **argv) } } // load font - len = 32*1024; // can't be larger + len = 128*1024; buffer = xmalloc_open_zipped_read_close(*argv, &len); if (!buffer) bb_simple_perror_msg_and_die(*argv); |