summaryrefslogtreecommitdiff
path: root/libpurple/mediamanager.c
diff options
context:
space:
mode:
authorGary Kramlich <grim@reaperworld.com>2021-02-07 01:42:09 -0600
committerGary Kramlich <grim@reaperworld.com>2021-02-07 01:42:09 -0600
commitbb01a2f383df86e9c917f6b755c1369d179ccdef (patch)
tree7c427fab30ab06365746c37aa1d1daa559ea3881 /libpurple/mediamanager.c
parentb74e34a077b5f15d79ba1f61ca4d353c4f41532d (diff)
downloadpidgin-bb01a2f383df86e9c917f6b755c1369d179ccdef.tar.gz
Implement mitigation for GHSL-2021-045
This add a static inline version of `g_memdup2` if the version of glib we're compiling against doesn't have the function. GHSL-2021-045 was originally reported to glib at https://gitlab.gnome.org/GNOME/glib/-/issues/2319. More information about the entire situation can be found on the gnome desktop-devel-list at https://mail.gnome.org/archives/desktop-devel-list/2021-February/msg00000.html Testing Done: Compiled and ran unit tests. Reviewed at https://reviews.imfreedom.org/r/482/
Diffstat (limited to 'libpurple/mediamanager.c')
-rw-r--r--libpurple/mediamanager.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpurple/mediamanager.c b/libpurple/mediamanager.c
index 15083461ae..9d515c0fa3 100644
--- a/libpurple/mediamanager.c
+++ b/libpurple/mediamanager.c
@@ -25,6 +25,7 @@
#include "account.h"
#include "debug.h"
+#include "glibcompat.h"
#include "media.h"
#include "mediamanager.h"
@@ -1696,7 +1697,7 @@ purple_media_manager_send_application_data (
media, session_id, participant);
if (info && info->appsrc && info->connected) {
- GstBuffer *gstbuffer = gst_buffer_new_wrapped (g_memdup (buffer, size),
+ GstBuffer *gstbuffer = gst_buffer_new_wrapped (g_memdup2(buffer, size),
size);
GstAppSrc *appsrc = gst_object_ref (info->appsrc);