cryptodotis / irssi-otr

LibOTR functionality in Irssi.
GNU General Public License v2.0
183 stars 24 forks source link

Assertion failed when sending message #48

Closed valeriangalliat closed 9 years ago

valeriangalliat commented 9 years ago

Hi, I'm using irssi (0.8.16), irssi-otr and irssi-xmpp from FreeBSD binary packages.

Sometimes when chatting over XMPP with OTR, I have an assertion failed here and this crashes my Irssi.

I use OTR only with a friend using Pidgin on Windows, so I don't know if this is part of the problem or no. I tried a few minutes an XMPP/OTR conversation with my Arch Linux PC with a test account, but I had no problem. Also fine with OTR over IRC query.

Usually the crash happens a few messages after the OTR initialization, just when I press enter to send a message (usualy the second or third message I send).

Is there anything I can do to help solving this bug?

dgoulet commented 9 years ago

So yeah, I think we had report of this happening before but seems to happen "sometimes".

One thing you can try to help with is to test this patch and tell us if you still have the issue or see new issue(s) :).

diff --git a/src/module.c b/src/module.c
index 5877315..96b409f 100644
--- a/src/module.c
+++ b/src/module.c
@@ -292,7 +292,9 @@ error_alloc:
 void irssi_send_message(SERVER_REC *irssi, const char *recipient,
        const char *msg)
 {
-   assert(irssi);
+   if (!irssi) {
+       return;
+   }

    irssi->send_message(irssi, recipient, msg,
            GPOINTER_TO_INT(SEND_TARGET_NICK));
valeriangalliat commented 9 years ago

Thanks! I'll try this as soon as my friend with whom I have the bug is available.

valeriangalliat commented 9 years ago

Looks like it's working well, thank you again.