From 5024c64c833130a7c6179bf67ba7622ffe9d2405 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Thu, 10 Oct 2019 20:42:00 +0200 Subject: [PATCH] glib-2.0: Guard against passing null source to GLib.Memory.copy() Found by -fsanitize=undefined --- vapi/glib-2.0.vapi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index d5229327d..7e8cfab81 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -1465,8 +1465,10 @@ public class string { GLib.Memory.copy (dest, this, start); dest += start; - GLib.Memory.copy (dest, str, str_size); - dest += str_size; + if (str != null) { + GLib.Memory.copy (dest, str, str_size); + dest += str_size; + } GLib.Memory.copy (dest, (char*) this + end, string_length - end); -- 2.47.2