From c776fc17bfeaa607405fc96620e9445e7a0965c3 Mon Sep 17 00:00:00 2001 From: Werner Lemberg <wl@gnu.org> Date: Sat, 25 Feb 2012 13:21:01 +0000 Subject: [pcf] Fix Savannah bug #35603. * src/pcf/pcfread.c (pcf_get_properties): Assure final zero byte in `strings' array. --- diff --git a/src/pcf/pcfread.c b/src/pcf/pcfread.c index f8c2a23..d9914c0 100644 --- a/src/pcf/pcfread.c +++ b/src/pcf/pcfread.c @@ -496,7 +495,8 @@ THE SOFTWARE. goto Bail; } - if ( FT_NEW_ARRAY( strings, string_size ) ) + /* allocate one more byte so that we have a final null byte */ + if ( FT_NEW_ARRAY( strings, string_size + 1 ) ) goto Bail; error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size ); -- cgit v0.9.0.2