[cff] Avoid null pointer passed to FT_MEM_COPY (#48984).

* src/cff/cffload.c (cff_index_get_name): Check `byte_len'.
This commit is contained in:
Werner Lemberg 2016-09-03 06:33:36 +02:00
parent d87bb9160a
commit f0fa7a67bf
2 changed files with 8 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2016-09-03 Werner Lemberg <wl@gnu.org>
[cff] Avoid null pointer passed to FT_MEM_COPY (#48984).
* src/cff/cffload.c (cff_index_get_name): Check `byte_len'.
2016-09-02 Werner Lemberg <wl@gnu.org> 2016-09-02 Werner Lemberg <wl@gnu.org>
[unix] Enable 64bit support in file system access (#48962). [unix] Enable 64bit support in file system access (#48962).

View File

@ -602,7 +602,8 @@
if ( !FT_ALLOC( name, byte_len + 1 ) ) if ( !FT_ALLOC( name, byte_len + 1 ) )
{ {
FT_MEM_COPY( name, bytes, byte_len ); if ( byte_len )
FT_MEM_COPY( name, bytes, byte_len );
name[byte_len] = 0; name[byte_len] = 0;
} }
cff_index_forget_element( idx, &bytes ); cff_index_forget_element( idx, &bytes );