diff options
author | Ken Sharp <ken.sharp@artifex.com> | 2010-10-08 13:37:05 +0000 |
---|---|---|
committer | Ken Sharp <ken.sharp@artifex.com> | 2010-10-08 13:37:05 +0000 |
commit | 0a4a426c7828c80ec96921b0d6340990a62724a3 (patch) | |
tree | 1c4d98deb1d1072703201aa748b63d6d314e5c22 /gs/base/gdevpdtt.c | |
parent | bf15bc19d7c19c3c233764c78f2f75041efe4965 (diff) |
Prevent a possible attempt to memset a NULL pointer. This was probably safe since the
size of the memset would be 0 bytes, but its best to be safe.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@11777 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/base/gdevpdtt.c')
-rw-r--r-- | gs/base/gdevpdtt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gs/base/gdevpdtt.c b/gs/base/gdevpdtt.c index 50e0cdd35..37049402d 100644 --- a/gs/base/gdevpdtt.c +++ b/gs/base/gdevpdtt.c @@ -583,7 +583,8 @@ alloc_font_cache_elem_arrays(gx_device_pdf *pdev, pdf_font_cache_elem_t *e, e->num_chars = num_chars; e->num_widths = num_widths; memset(e->glyph_usage, 0, len); - memset(e->real_widths, 0, num_widths * sizeof(*e->real_widths)); + if (e->real_widths != NULL) + memset(e->real_widths, 0, num_widths * sizeof(*e->real_widths)); return 0; } |