summaryrefslogtreecommitdiff
path: root/net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
committerV3n3RiX <venerix@koprulu.sector>2022-05-12 16:42:50 +0300
commit752d6256e5204b958b0ef7905675a940b5e9172f (patch)
tree330d16e6362a49cbed8875a777fe641a43376cd3 /net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch
parent0c100b7dd2b30e75b799d806df4ef899fd98e1ea (diff)
gentoo resync : 12.05.2022
Diffstat (limited to 'net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch')
-rw-r--r--net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch b/net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch
new file mode 100644
index 000000000000..f75714a75058
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch
@@ -0,0 +1,40 @@
+https://github.com/mcabber/loudmouth/pull/46
+
+From f32119e1408c742da9a1862805d76d222937756d Mon Sep 17 00:00:00 2001
+From: psykose <alice@ayaya.dev>
+Date: Thu, 21 Apr 2022 18:23:32 +0000
+Subject: [PATCH] fix macro define for freeaddrinfo with asyncns
+
+previously, this define was only made in lm-asyncns-resolver.c, which
+does not propagate it to lm-resolver.c, where freeaddrinfo() is used.
+this means that when asyncns support is used, the standard libc
+freeaddrinfo() is called on an addrinfo acquired from
+asyncns_getaddrinfo, which is undefined behaviour, and leads to a
+segfault on musl libc.
+--- a/loudmouth/lm-asyncns-resolver.c
++++ b/loudmouth/lm-asyncns-resolver.c
+@@ -21,7 +21,6 @@
+ #include <string.h>
+ #ifdef HAVE_ASYNCNS
+ #include <asyncns.h>
+-#define freeaddrinfo(x) asyncns_freeaddrinfo(x)
+
+ /* Needed on Mac OS X */
+ #if HAVE_ARPA_NAMESER_COMPAT_H
+--- a/loudmouth/lm-asyncns-resolver.h
++++ b/loudmouth/lm-asyncns-resolver.h
+@@ -19,8 +19,14 @@
+ #ifndef __LM_ASYNCNS_RESOLVER_H__
+ #define __LM_ASYNCNS_RESOLVER_H__
+
++#include <config.h>
++
+ #include <glib-object.h>
+
++#ifdef HAVE_ASYNCNS
++#define freeaddrinfo(x) asyncns_freeaddrinfo(x)
++#endif
++
+ #include "lm-resolver.h"
+
+ G_BEGIN_DECLS