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 tests locally.
Reviewed at https://reviews.imfreedom.org/r/483/
/*
* Purple's oscar protocol plugin
* This file is the legal property of its developers.
* Please see the AUTHORS file distributed alongside this file.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
/*
* Functions dealing with peer connections. This includes the code
* used to establish a peer connection for both Oscar File transfer
* (OFT) and Oscar Direct Connect (ODC). (ODC is also referred to
* as DirectIM and IM Image.)
*/
#ifdef HAVE_CONFIG_H
#include<config.h>
#endif
/* From the oscar PRPL */
#include"oscar.h"
#include"peer.h"
/* From Purple */
#include"conversation.h"
#include"ft.h"
#include"network.h"
#include"notify.h"
#include"request.h"
#include"util.h"
#ifndef _WIN32
#include<stdio.h>
#include<netdb.h>
#include<sys/socket.h>
#include<netinet/in.h>
#include<arpa/inet.h> /* for inet_ntoa */
#include<limits.h> /* for UINT_MAX */
#endif
#ifdef _WIN32
#include"win32dep.h"
#endif
/*
* I really want to switch all our networking code to using IPv6 only,
* but that really isn't a good idea at all. Evan S. of Adium says
* OS X sets all connections as "AF_INET6/PF_INET6," even if there is
* nothing inherently IPv6 about them. And I feel like Linux kernel
* 2.6.5 is doing the same thing. So we REALLY should accept
* connections if they're showing up as IPv6. Old OSes (Solaris?)
* that might not have full IPv6 support yet will fail if we try
* to use PF_INET6 but it isn't defined. --Mark Doliner