diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-05-08 13:13:57 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-05-08 13:13:57 +0200 |
commit | 58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116 (patch) | |
tree | 01811533bdab6abd4d7188ddd0d0b14c4dc5ee53 | |
parent | 0.0.9 (diff) | |
download | ircxmpp-58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116.tar ircxmpp-58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116.tar.gz ircxmpp-58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116.tar.bz2 ircxmpp-58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116.tar.lz ircxmpp-58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116.tar.xz ircxmpp-58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116.tar.zst ircxmpp-58d57e2a7a92cf3a14fd4b14eb0f96e2201a9116.zip |
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | ircxmpp.c | 26 |
2 files changed, 20 insertions, 12 deletions
diff --git a/debian/changelog b/debian/changelog index f21b1f4..f366f51 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ircxmpp (0.0.10-1) stable; urgency=low + + * do not use 0.0.9 + + -- Anton Luka Šijanec <anton@sijanec.eu> Sun, 8 May 2022 13:15:00 +0200 + ircxmpp (0.0.9-1) stable; urgency=low * how did this slip my extensive testing? @@ -138,18 +138,20 @@ static void bridge_forward (const char * f, const char * m, struct ircxmpp * irc bridge->side = !s; tsearch(bridge, &ircxmpp->bridges, bridge_compare); if (s == IRC) { - char buf[512+512+strlen(ircxmpp->domain)]; // for good measure, i think - char * cp = strchr(f, '@'); // 512+1+strlen is enough - if (cp) { // cmiiw - strncpy(buf, cp+1, 511); - buf[511] = '\0'; - } else - strcpy(buf, "unable.to.extract.domain.from.JID"); - *strchrnul(buf, '/') = '\0'; - if (buf[strlen(buf)-1] != '.') // jid domain can probably end with a dot. - strcat(buf, "."); // two consecutive dots would invalidate - strcat(buf, ircxmpp->domain); // the domain - ircxmpp->domain_setter(ircxmpp->domain_setter_userdata, buf); + if (ircxmpp->domain) { + char buf[512+512+strlen(ircxmpp->domain)]; // for good measure + char * cp = strchr(f, '@'); // 512+1+strlen is ok + if (cp) { // cmiiw + strncpy(buf, cp+1, 511); + buf[511] = '\0'; + } else + strcpy(buf, "unable.to.extract.domain.from.JID"); + *strchrnul(buf, '/') = '\0'; + if (buf[strlen(buf)-1] != '.') // jid domain can probably end with . + strcat(buf, "."); // two consecutive dots would + strcat(buf, ircxmpp->domain); // +invalidate the domain + ircxmpp->domain_setter(ircxmpp->domain_setter_userdata, buf); + } init_irc(bridge); } else { bridge->conn = xmpp_conn_new(bridge->ircxmpp->ctx); |