tlibdraw, acme: fix acme segfault triggered passing an invalid font - plan9port - [fork] Plan 9 from user space (HTM) git clone git://src.adamsgaard.dk/plan9port (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit 25822e8da338df2c15959bd8d347f230dc2b2d89 (DIR) parent 3aca22118d808597bc7451adc559d89460ed5a6e (HTM) Author: Gleydson Soares <gsoares@gmail.com> Date: Sat, 21 Mar 2015 00:24:09 -0300 libdraw, acme: fix acme segfault triggered passing an invalid font acme -f nosuchfont Change-Id: Iaa727db02b43e63082130796ec97c0efb7fe2b19 Reviewed-on: https://plan9port-review.googlesource.com/1220 Reviewed-by: Russ Cox <rsc@swtch.com> Diffstat: M src/libdraw/openfont.c | 2 ++ 1 file changed, 2 insertions(+), 0 deletions(-) --- (DIR) diff --git a/src/libdraw/openfont.c b/src/libdraw/openfont.c t@@ -221,6 +221,8 @@ openfont(Display *d, char *name) *p = '\0'; f = openfont1(d, name); + if(!f) + return nil; f->lodpi = f; f->namespec = namespec;