plan9fox/sys
cinap_lenrek 796e7b84bd libdraw: fix out of bounds memory access after subfont array reallocation (thanks ray)
/n/bugs/open/libdrawfont.c_buffer_overflow
http://bugs.9front.org/open/libdrawfont.c_buffer_overflow/readme

ray@raylai.com

Hi all,

In plan9port this bug keeps crashing mc when I run lc in a directory with Chinese characters. This is a diff from OpenBSD but it should apply cleanly to the various plan9 sources.

The code is basically trying to do a realloc (I guess realloc wasn't available back then?) but it copies too much from the original buffer.

Since realloc is available, just use it. If realloc isn't available outside plan9port (I haven't checked) the memmove line should be changed from:
	memmove(f->subf, of, (f->nsubf+DSUBF)*sizeof *subf);
to:
	memmove(f->subf, of, f->nsubf*sizeof *subf);

I hope this is helpful.

Ray
2016-04-05 11:24:07 +02:00
..
doc /sys/doc: permissions for cleanps, mkdirlist, mkfilelist 2012-10-20 19:09:54 +02:00
games/lib fortunes: Ah, nice. the woodpeckers are back. 2016-03-30 21:14:39 -04:00
include add portable AES-GCM (Galois/Counter Mode) implementation to libsec and devtls 2016-03-23 02:45:35 +01:00
lib mercurial: CVE-2016-3630 2016-04-03 04:04:56 +02:00
man kbdfs(8): document new /dev/kbd behaviour 2016-04-03 23:16:08 +02:00
src libdraw: fix out of bounds memory access after subfont array reallocation (thanks ray) 2016-04-05 11:24:07 +02:00