From 6f754852c19ff26d693a1d78de55bab263281a72 Mon Sep 17 00:00:00 2001 From: Garret Rieger Date: Tue, 11 Aug 2020 15:40:47 -0700 Subject: [PATCH] [ENOMEM] skip asserts in to_bias if serializer is in an error state. --- src/hb-serialize.hh | 1 + ...-minimized-hb-subset-fuzzer-5927551890096128 | Bin 0 -> 73364 bytes 2 files changed, 1 insertion(+) create mode 100644 test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5927551890096128 diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index 3ce1b8019..4566153a5 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -332,6 +332,7 @@ struct hb_serialize_context_t unsigned to_bias (const void *base) const { + if (unlikely (in_error ())) return 0; if (!base) return 0; assert (current); assert (current->head <= (const char *) base); diff --git a/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5927551890096128 b/test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5927551890096128 new file mode 100644 index 0000000000000000000000000000000000000000..a5f5af8c8a3009910e7d68b28d15a824852e9562 GIT binary patch literal 73364 zcmeHw3t-g6x$n&UAN$YdpUpp;&2BcEWV2Z|%eq~bJT{y6146(ULZsZ3#uP&gF(5Au zD9Tl!l&V$4S3PJs=%E~sm&>J=szqw4Vjs8F)7ILD_LNp^ZEf{h+xn;$vgbGd%_br0 zDVG2T?d)TA=kcG%H{Z;B^UZwUH*dj$c|<20iA0)awssaBENK1_A>_v!34LcaAs;8X z#120p(@E3p&Ux^^@E1a~o_8DHetX`>qsCRzpVt$j<|0M!f6Rh=QQrTBe;pxN>ZMDE zRuhYbP(mJIV4qSO0qZQ?%-T4?i*d#^c1AxPee*zp@|hy)u1{+$k@Vd*wm7X5%_}qkMyWtGr#lPkumt zP(CDoTmC)(Clg8+jr^XU{3ZP(eme5oNRFE6c5*+X)cnPBW4~$SSYmj1aUz-DPG0<{ z2}|^om(@SwArlyIldl7b1j5*gN(sg=mW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