From d9e9ba70a03a1c48811aff178365fce91394881a Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Thu, 20 May 2021 15:58:53 -0500 Subject: [PATCH] gdatainputstream: replace easy use of g_memdup() This code is passing a gsize, so might as well switch this to g_memdup2(). This is the only use of g_memdup() in GLib 2.56 that is not part of GLib 2.58. All other uses analyzed in glib!2000. --- gio/gdatainputstream.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gio/gdatainputstream.c b/gio/gdatainputstream.c index 9f207b158..ebef7c797 100644 --- a/gio/gdatainputstream.c +++ b/gio/gdatainputstream.c @@ -27,6 +27,7 @@ #include "gioenumtypes.h" #include "gioerror.h" #include "glibintl.h" +#include "gstrfuncsprivate.h" #include @@ -1082,7 +1083,7 @@ g_data_input_stream_read_async (GDataInputStream *stream, data = g_slice_new0 (GDataInputStreamReadData); if (stop_chars_len == -1) stop_chars_len = strlen (stop_chars); - data->stop_chars = g_memdup (stop_chars, stop_chars_len); + data->stop_chars = g_memdup2 (stop_chars, stop_chars_len); data->stop_chars_len = stop_chars_len; data->last_saw_cr = FALSE;