From: Rico Tzschichholz Date: Thu, 10 Oct 2019 18:42:00 +0000 (+0200) Subject: glib-2.0: Guard against passing null source to GLib.Memory.copy() X-Git-Tag: 0.44.10~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cebd8220f0005d686521cabfda2b3e03637d22a;p=thirdparty%2Fvala.git glib-2.0: Guard against passing null source to GLib.Memory.copy() Found by -fsanitize=undefined --- diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index d4e21ce48..880283ca7 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);