Avoid potential negative array index access to cached text.
[LibreOffice.git] / external / freetype / ubsan.patch
blob80446ac5c89c82d131b2360f3515caf3a08ce72c
1 --- src/psaux/psobjs.c.orig 2023-02-04 23:00:05.000000000 +0900
2 +++ src/psaux/psobjs.c 2023-02-22 16:28:26.632283841 +0900
3 @@ -200,7 +200,8 @@
4 /* add the object to the base block and adjust offset */
5 table->elements[idx] = FT_OFFSET( table->block, table->cursor );
6 table->lengths [idx] = length;
7 - FT_MEM_COPY( table->block + table->cursor, object, length );
8 + if (length != 0)
9 + FT_MEM_COPY( table->block + table->cursor, object, length );
11 table->cursor += length;
12 return FT_Err_Ok;