* psobjs.c (ps_table_add): Check length before calling `FT_MEM_CPY`.

Fixes issue #1280.
adjust
Philip Race 8 months ago committed by Werner Lemberg
parent 2280346192
commit 37cefe33b2
  1. 4
      src/psaux/psobjs.c

@ -201,7 +201,9 @@
/* add the object to the base block and adjust offset */
table->elements[idx] = FT_OFFSET( table->block, table->cursor );
table->lengths [idx] = length;
FT_MEM_COPY( table->block + table->cursor, object, length );
/* length == 0 also implies a NULL destination, so skip the copy call */
if ( length > 0 )
FT_MEM_COPY( table->block + table->cursor, object, length );
table->cursor += length;
return FT_Err_Ok;

Loading…
Cancel
Save