diff options
author | Timm Bäder <mail@baedert.org> | 2020-06-10 05:54:27 +0200 |
---|---|---|
committer | Timm Bäder <mail@baedert.org> | 2020-06-10 05:54:27 +0200 |
commit | 29674a51c0cd9a41e323fe7e3473ca327b79c3f4 (patch) | |
tree | 4a9a129790239626ef704b67ed3b9ff6166e7f2c /pango/pango-tabs.c | |
parent | dc5e67b2d74386f6482f6b978f972c4bfd8401cf (diff) | |
download | pango-29674a51c0cd9a41e323fe7e3473ca327b79c3f4.tar.gz |
pango-tabs: Avoid passing NULL to memcpy
pango_tab_array_new might not actually allocate anything for ->tabs.
Diffstat (limited to 'pango/pango-tabs.c')
-rw-r--r-- | pango/pango-tabs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pango/pango-tabs.c b/pango/pango-tabs.c index 1ffa8356..56a34468 100644 --- a/pango/pango-tabs.c +++ b/pango/pango-tabs.c @@ -192,7 +192,8 @@ pango_tab_array_copy (PangoTabArray *src) copy = pango_tab_array_new (src->size, src->positions_in_pixels); - memcpy (copy->tabs, src->tabs, sizeof(PangoTab)*src->size); + if (copy->tabs) + memcpy (copy->tabs, src->tabs, sizeof(PangoTab) * src->size); return copy; } |