diff -Nru charybdis-3.4.2/debian/changelog charybdis-3.4.2/debian/changelog
--- charybdis-3.4.2/debian/changelog	2014-06-09 21:00:17.000000000 -0400
+++ charybdis-3.4.2/debian/changelog	2015-11-13 16:49:15.000000000 -0500
@@ -1,3 +1,11 @@
+charybdis (3.4.2-5) unstable; urgency=high
+
+  * switch to new anonscm hostnames
+  * initialise gnutls properly (Closes: #768339, #705369)
+  * add fix for CVE-2015-5290, cherry-picked from upstream d5f856c^..172b58f
+
+ -- Antoine Beaupré <anarcat@debian.org>  Fri, 13 Nov 2015 16:35:35 -0500
+
 charybdis (3.4.2-4) unstable; urgency=medium
 
   * remove duplicate library depends with shlibs (Closes: #750833)
diff -Nru charybdis-3.4.2/debian/control charybdis-3.4.2/debian/control
--- charybdis-3.4.2/debian/control	2014-06-09 21:00:17.000000000 -0400
+++ charybdis-3.4.2/debian/control	2015-11-13 16:49:15.000000000 -0500
@@ -16,8 +16,8 @@
                flex
 Standards-Version: 3.9.5
 Homepage: http://www.atheme.org/projects/charybdis.html
-Vcs-Git: git://git.debian.org/collab-maint/charybdis.git -b debian
-Vcs-Browser: http://git.debian.org/?p=collab-maint/charybdis.git;a=summary
+Vcs-Git: git://anonscm.debian.org/collab-maint/charybdis.git -b debian
+Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/charybdis.git;a=summary
 
 Package: charybdis
 Architecture: any
diff -Nru charybdis-3.4.2/debian/patches/CVE-2015-5290 charybdis-3.4.2/debian/patches/CVE-2015-5290
--- charybdis-3.4.2/debian/patches/CVE-2015-5290	1969-12-31 19:00:00.000000000 -0500
+++ charybdis-3.4.2/debian/patches/CVE-2015-5290	2015-11-13 16:49:15.000000000 -0500
@@ -0,0 +1,94 @@
+diff --git a/include/monitor.h b/include/monitor.h
+index 102fe7e..2b638c6 100644
+--- a/include/monitor.h
++++ b/include/monitor.h
+@@ -14,13 +14,12 @@ struct rb_bh;
+ 
+ struct monitor
+ {
+-	struct monitor *hnext;
+ 	char name[NICKLEN];
+ 	rb_dlink_list users;
++	rb_dlink_node node;
++	unsigned int hashv;
+ };
+ 
+-extern struct monitor *monitorTable[];
+-
+ #define MONITOR_HASH_BITS 16
+ #define MONITOR_HASH_SIZE (1<<MONITOR_HASH_BITS)
+ 
+diff --git a/modules/m_monitor.c b/modules/m_monitor.c
+index a6ce575..11b45e8 100644
+--- a/modules/m_monitor.c
++++ b/modules/m_monitor.c
+@@ -181,6 +181,8 @@ del_monitor(struct Client *client_p, const char *nicks)
+ 
+ 		rb_dlinkFindDestroy(client_p, &monptr->users);
+ 		rb_dlinkFindDestroy(monptr, &client_p->localClient->monitor_list);
++
++		free_monitor(monptr);
+ 	}
+ }
+ 
+diff --git a/src/monitor.c b/src/monitor.c
+index 280ef59..e9dac7d 100644
+--- a/src/monitor.c
++++ b/src/monitor.c
+@@ -37,7 +37,7 @@
+ #include "hash.h"
+ #include "numeric.h"
+ 
+-struct monitor *monitorTable[MONITOR_HASH_SIZE];
++static rb_dlink_list monitorTable[MONITOR_HASH_SIZE];
+ static rb_bh *monitor_heap;
+ 
+ void
+@@ -56,11 +56,13 @@ struct monitor *
+ find_monitor(const char *name, int add)
+ {
+ 	struct monitor *monptr;
++	rb_dlink_node *ptr;
+ 
+ 	unsigned int hashv = hash_monitor_nick(name);
+ 
+-	for(monptr = monitorTable[hashv]; monptr; monptr = monptr->hnext)
++	RB_DLINK_FOREACH(ptr, monitorTable[hashv].head)
+ 	{
++		monptr = ptr->data;
+ 		if(!irccmp(monptr->name, name))
+ 			return monptr;
+ 	}
+@@ -69,10 +71,9 @@ find_monitor(const char *name, int add)
+ 	{
+ 		monptr = rb_bh_alloc(monitor_heap);
+ 		rb_strlcpy(monptr->name, name, sizeof(monptr->name));
++		monptr->hashv = hashv;
+ 
+-		monptr->hnext = monitorTable[hashv];
+-		monitorTable[hashv] = monptr;
+-
++		rb_dlinkAdd(monptr, &monptr->node, &monitorTable[hashv]);
+ 		return monptr;
+ 	}
+ 
+@@ -82,6 +83,10 @@ find_monitor(const char *name, int add)
+ void
+ free_monitor(struct monitor *monptr)
+ {
++	if (rb_dlink_list_length(&monptr->users) > 0)
++		return;
++
++	rb_dlinkDelete(&monptr->node, &monitorTable[monptr->hashv]);
+ 	rb_bh_free(monitor_heap, monptr);
+ }
+ 
+@@ -139,6 +144,8 @@ clear_monitor(struct Client *client_p)
+ 
+ 		rb_dlinkFindDestroy(client_p, &monptr->users);
+ 		rb_free_rb_dlink_node(ptr);
++
++		free_monitor(monptr);
+ 	}
+ 
+ 	client_p->localClient->monitor_list.head = client_p->localClient->monitor_list.tail = NULL;
diff -Nru charybdis-3.4.2/debian/patches/libratbox-gnutls-add-gnutls-v3-api-compatibility-wit.patch charybdis-3.4.2/debian/patches/libratbox-gnutls-add-gnutls-v3-api-compatibility-wit.patch
--- charybdis-3.4.2/debian/patches/libratbox-gnutls-add-gnutls-v3-api-compatibility-wit.patch	1969-12-31 19:00:00.000000000 -0500
+++ charybdis-3.4.2/debian/patches/libratbox-gnutls-add-gnutls-v3-api-compatibility-wit.patch	2015-11-13 16:49:15.000000000 -0500
@@ -0,0 +1,72 @@
+From 7aa40f6d2c50abed003ef471b2c5b700f73af4e3 Mon Sep 17 00:00:00 2001
+From: William Pitcock <nenolod@dereferenced.org>
+Date: Sat, 8 Feb 2014 18:34:49 +0000
+Subject: [PATCH] libratbox/gnutls: add gnutls v3 api compatibility without
+ breaking v2
+
+---
+ libratbox/src/gnutls.c | 18 +++++++++++++++++-
+ 1 file changed, 17 insertions(+), 1 deletion(-)
+
+diff --git a/libratbox/src/gnutls.c b/libratbox/src/gnutls.c
+index 0323181..f87fe89 100644
+--- a/libratbox/src/gnutls.c
++++ b/libratbox/src/gnutls.c
+@@ -31,7 +31,11 @@
+ 
+ #include <gnutls/gnutls.h>
+ #include <gnutls/x509.h>
+-#include <gcrypt.h>
++#include <gnutls/crypto.h>
++
++#if GNUTLS_VERSION_MAJOR < 3
++# include <gcrypt.h>
++#endif
+ 
+ static gnutls_certificate_credentials x509;
+ static gnutls_dh_params dh_params;
+@@ -246,7 +250,9 @@ rb_ssl_write(rb_fde_t *F, const void *buf, size_t count)
+ static void
+ rb_gcry_random_seed(void *unused)
+ {
++#if GNUTLS_VERSION_MAJOR < 3
+ 	gcry_fast_random_poll();
++#endif
+ }
+ 
+ int
+@@ -527,21 +533,31 @@ rb_ssl_start_connected(rb_fde_t *F, CNCB * callback, void *data, int timeout)
+ int
+ rb_init_prng(const char *path, prng_seed_t seed_type)
+ {
++#if GNUTLS_VERSION_MAJOR < 3
+ 	gcry_fast_random_poll();
++#endif
+ 	return 1;
+ }
+ 
+ int
+ rb_get_random(void *buf, size_t length)
+ {
++#if GNUTLS_VERSION_MAJOR < 3
+ 	gcry_randomize(buf, length, GCRY_STRONG_RANDOM);
++#else
++	gnutls_rnd(GNUTLS_RND_KEY, buf, length);
++#endif
+ 	return 1;
+ }
+ 
+ int
+ rb_get_pseudo_random(void *buf, size_t length)
+ {
++#if GNUTLS_VERSION_MAJOR < 3
+ 	gcry_randomize(buf, length, GCRY_WEAK_RANDOM);
++#else
++	gnutls_rnd(GNUTLS_RND_RANDOM, buf, length);
++#endif
+ 	return 1;
+ }
+ 
+-- 
+2.1.4
+
diff -Nru charybdis-3.4.2/debian/patches/series charybdis-3.4.2/debian/patches/series
--- charybdis-3.4.2/debian/patches/series	2014-06-09 21:00:17.000000000 -0400
+++ charybdis-3.4.2/debian/patches/series	2015-11-13 16:49:15.000000000 -0500
@@ -4,3 +4,5 @@
 extra-clean
 gnutls.patch
 gnutls30
+libratbox-gnutls-add-gnutls-v3-api-compatibility-wit.patch
+CVE-2015-5290
