This PR fixes a corner case where an uninitialized value could be passed to 
free if a malloc of a small array fails.

The cleanup code for 
`Java_com_sun_javafx_font_freetype_OSFreetype_FT_1Outline_1Decompose` in 
freetype.c checks the `data.pointTypes` and `data.pointCoords` pointers and 
frees them if not null.

if the malloc for the first of these two fails, the second will not have been 
initialized yet, in which case the uninitialized value would be passed to free.

NOTE: This fix is in Linux-specific platform code. All code in freetype.c is 
under an ifdef for Linux (or Android).

-------------

Commit messages:
 - 8379211: Uninitialised memory in 
Java_com_sun_javafx_font_freetype_OSFreetype_FT_1Outline_1Decompose

Changes: https://git.openjdk.org/jfx/pull/2132/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2132&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8379211
  Stats: 4 lines in 1 file changed: 3 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jfx/pull/2132.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2132/head:pull/2132

PR: https://git.openjdk.org/jfx/pull/2132

Reply via email to