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
*/
/*
* Cookie Caching stuff. Adam wrote this, apparently just some
* derivatives of n's SNAC work. I cleaned it up, added comments.
*
*/
/*
* I'm assuming that cookies are type-specific. that is, we can have
* "1234578" for type 1 and type 2 concurrently. if i'm wrong, then we
* lose some error checking. if we assume cookies are not type-specific and are
* wrong, we get quirky behavior when cookies step on each others' toes.
*/
#include"oscar.h"
/**
* aim_cachecookie - appends a cookie to the cookie list
*
* if cookie->cookie for type cookie->type is found, updates the
* ->addtime of the found structure; otherwise adds the given cookie
* to the cache
*
* @param od session to add to
* @param cookie pointer to struct to append
* @return returns -1 on error, 0 on append, 1 on update. the cookie you pass
* in may be free'd, so don't count on its value after calling this!