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
*/
/*
* Family 0x0013 - Server-Side/Stored Information.
*
* Relatively new facility that allows certain types of information, such as
* a user's buddy list, permit/deny list, and permit/deny preferences, to be
* stored on the server, so that they can be accessed from any client.
*
* We keep 2 copies of SSI data:
* 1) An exact copy of what is stored on the AIM servers.
* 2) A local copy that we make changes to, and then send diffs
* between this and the exact copy to keep them in sync.
*
* All the "aim_ssi_itemlist_bleh" functions near the top just modify the list
* that is given to them (i.e. they don't send SNACs).
*
* The SNAC sending and receiving functions are lower down in the file, and
* they're simpler. They are in the order of the subtypes they deal with,
* starting with the request rights function (subtype 0x0002), then parse
* rights (subtype 0x0003), then--well, you get the idea.
*
* This is entirely too complicated.
* You don't know the half of it.
*
*/
#include"oscar.h"
#include"debug.h"
staticintaim_ssi_addmoddel(OscarData*od);
/**
* List types based on http://dev.aol.com/aim/oscar/#FEEDBAG (archive.org)
* and http://iserverd.khstu.ru/oscar/ssi_item.html
*
* @param type The type of a list item as integer number, as provided by an aim_ssi_item struct.
* @return Returns the name of the item type as a character string.
*/
staticconstgchar*
aim_ssi_type_to_string(guint16type)
{
structTypeStringPair
{
guint16type;
constgchar*string;
};
staticconststructTypeStringPairtype_strings[]={
{0x0000,"Buddy"},
{0x0001,"Group"},
{0x0002,"Permit/Visible"},
{0x0003,"Deny/Invisible"},
{0x0004,"PDInfo"},
{0x0005,"PresencePrefs"},
{0x0006,"Non-Buddy Info"},
{0x0009,"ClientPrefs"},
{0x000e,"ICQDeny/Ignore"},
{0x0014,"Buddy Icon"},
{0x0015,"Recent Buddies"},
{0x0019,"Non-Buddy"},
{0x001d,"Vanity Info"},
{0x0020,"ICQ-MDir"},
{0x0029,"Facebook"},
};
size_ti;
for(i=0;i<G_N_ELEMENTS(type_strings);i++){
if(type_strings[i].type==type){
returntype_strings[i].string;
}
}
return"unknown";
}
/** For debug log output: Appends a line containing information about a given list item to a string.
*
* @param str String to which the line will be appended.
* @param prefix A string which will be prepended to the line.
* @param item List item from which information is extracted.