# HG changeset patch # User Jason Rumney # Date 1207237090 0 # Node ID 5476a4f5d2f263b45320b9fbd6e84551e8482356 # Parent 40e064117c8a4a2a30f8848d098325ec2c5c6af8 (uniscribe_check_otf): Sanity check otf_spec. diff -r 40e064117c8a -r 5476a4f5d2f2 src/w32uniscribe.c --- a/src/w32uniscribe.c Thu Apr 03 13:42:25 2008 +0000 +++ b/src/w32uniscribe.c Thu Apr 03 15:38:10 2008 +0000 @@ -564,6 +564,10 @@ DWORD table; int i, retval = 0; + /* Check the spec is in the right format. */ + if (!CONSP (otf_spec) || Flength (val) < 3) + return 0; + /* Break otf_spec into its components. */ script = XCAR (otf_spec); rest = XCDR (otf_spec); @@ -609,6 +613,10 @@ if (NILP (features[i])) continue; + /* If features is not a cons, this font spec is messed up. */ + if (!CONSP (features[i])) + goto no_support; + /* Read GPOS/GSUB header. */ OTF_INT16_VAL (tbl, 4, &scriptlist_table); OTF_INT16_VAL (tbl, 6, &feature_table);