[pango/wip/baedert/for-master: 52/53] pango-tabs: Avoid passing NULL to memcpy
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango/wip/baedert/for-master: 52/53] pango-tabs: Avoid passing NULL to memcpy
- Date: Wed, 10 Jun 2020 04:13:20 +0000 (UTC)
commit 29674a51c0cd9a41e323fe7e3473ca327b79c3f4
Author: Timm Bäder <mail baedert org>
Date: Wed Jun 10 05:54:27 2020 +0200
pango-tabs: Avoid passing NULL to memcpy
pango_tab_array_new might not actually allocate anything for ->tabs.
pango/pango-tabs.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]