[OTR-dev] Bug in libotr-3.1 / 3.2: no herthbeat message is send

Evan Schoenberg evan.s at dreskin.net
Fri Sep 12 14:35:22 EDT 2008


On Sep 12, 2008, at 1:57 PM, Ian Goldberg <ian at cypherpunks.ca> wrote:

> On Fri, Sep 12, 2008 at 07:28:24PM +0300, Marti Raudsepp wrote:
>> Bump. Still no official response from OTR developers?
>
> Oops; sorry about that.  This message got lost in the shuffle.
>
>> On Fri, Jul 25, 2008 at 7:32 PM, Georg Sievers  
>> <georgsievers at gmx.net> wrote:
>>> Hallo,
>>>
>>> my name is Georg Sievers and I' m just working on a diploma thesis
>>> at the university of applied sciences TFH, Berlin, Germany, which
>>> deals with possible usecases for OTR/libotr beyond Instant
>>> Messaging.
>>>
>>> I belive I found a remarkable bug in libotr.  In message.c, funktion
>>> "otrl_message_receiving" the field "edata.ignore_message" is
>>> initialised with "-1" (Line 747, libotr-3.2).
>>>
>>> In Line 1088 a check for "edata.ignore_message == 0" is performed,
>>> which will always evaluate to false, preventing the following
>>> hearthbeat-sending code from beeing executed. So no heartbeat
>>> messages are ever send.  A quick fix should be changing
>>> "edata.ignore_message == 0" to "edata.ignore_message != 1" (line
>>> 1088).
>
> Hmm.  It looks like you're right; that seems like a reasonable fix.
>
>>> Wathsoever, I don't feel to comfortable with having
>>> "ignore_message" set to an initale state "-1" at all. As far as I
>>> understood the  code, their doesn't seem to be a good reason for
>>> having a three-state flag at this point.
>
> The three states are "Definitely ignore", "definitely don't ignore",  
> and
> "I haven't decided what to do yet".
>
>>> I could offer to deliver a patch for this issue but first wanted to
>>> ask if there is some reason I have missed for doing it the way it is
>>> done.
>
> Do you think the patch is more than changing "== 0" to "!= 1"?

I think it should also change the magic numbers to values from a new  
enum to make their meaning clear in the future :)

-Evan

>
>
>   - Ian
> _______________________________________________
> OTR-dev mailing list
> OTR-dev at lists.cypherpunks.ca
> http://lists.cypherpunks.ca/mailman/listinfo/otr-dev
>



More information about the OTR-dev mailing list