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/
/**
* @file status.c Status API
* @ingroup core
*/
/* purple
*
* Purple is the legal property of its developers, whose names are too numerous
* to list here. Please refer to the COPYRIGHT file distributed with this
* source distribution.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
#define _PURPLE_STATUS_C_
#include"internal.h"
#include"blist.h"
#include"core.h"
#include"dbus-maybe.h"
#include"debug.h"
#include"notify.h"
#include"prefs.h"
#include"status.h"
/**
* A type of status.
*/
struct_PurpleStatusType
{
PurpleStatusPrimitiveprimitive;
char*id;
char*name;
char*primary_attr_id;
gbooleansaveable;
gbooleanuser_settable;
gbooleanindependent;
GList*attrs;
};
/**
* A status attribute.
*/
struct_PurpleStatusAttr
{
char*id;
char*name;
PurpleValue*value_type;
};
/**
* A list of statuses.
*/
struct_PurplePresence
{
PurplePresenceContextcontext;
gbooleanidle;
time_tidle_time;
time_tlogin_time;
GList*statuses;
GHashTable*status_table;
PurpleStatus*active_status;
union
{
PurpleAccount*account;
struct
{
PurpleConversation*conv;
char*user;
}chat;
struct
{
PurpleAccount*account;
char*name;
PurpleBuddy*buddy;
}buddy;
}u;
};
/**
* An active status.
*/
struct_PurpleStatus
{
PurpleStatusType*type;
PurplePresence*presence;
gbooleanactive;
/*
* The current values of the attributes for this status. The
* key is a string containing the name of the attribute. It is
* a borrowed reference from the list of attrs in the