# HG changeset patch # User Mikael Berthe # Date 1446762863 -3600 # Node ID 3958793d0d0318a899808553b794f14bf5d5c573 # Parent b56be18d5a04dd1bc2e78d3093876cc95c028275 otr_send: Fix my previous fix and abort if the initial message is empty diff -r b56be18d5a04 -r 3958793d0d03 mcabber/mcabber/otr.c --- a/mcabber/mcabber/otr.c Thu Nov 05 23:29:59 2015 +0100 +++ b/mcabber/mcabber/otr.c Thu Nov 05 23:34:23 2015 +0100 @@ -613,9 +613,12 @@ char *htmlmsg, *rmsg; ConnContext *ctx = otr_get_context(buddy); + if (!encryption_status) + return NULL; + *encryption_status = 0; - if (!msg || !buddy || !*encryption_status) + if (!buddy || !msg || !msg[0]) return NULL; if (ctx->msgstate == OTRL_MSGSTATE_PLAINTEXT) @@ -660,7 +663,7 @@ } /* Check the new message is not empty */ - if (newmessage[0] || !msg[0]) { + if (newmessage[0]) { rmsg = g_strdup(newmessage); } else { rmsg = NULL;