[OTR-dev] Typo error in otrl_context_forget function?
David Goulet
dgoulet at ev0ke.net
Wed Sep 17 14:37:21 EDT 2014
On 16 Sep (20:33:27), k007k wrote:
> Hi all,
>
> While debugging my plugin, I came across the following code in context.c:
>
> /* Forget a whole context, so long as it's PLAINTEXT. If a context has child
> * instances, don't remove this instance unless children are also all in
> * PLAINTEXT state. In this case, the children will also be removed.
> * Returns 0 on success, 1 on failure. */
> int otrl_context_forget(ConnContext *context)
> {
> if (context->msgstate != OTRL_MSGSTATE_PLAINTEXT) return 1;
>
> if (context->their_instance == OTRL_INSTAG_MASTER) {
> ConnContext *c_iter;
>
> for (c_iter = context; c_iter &&
> c_iter->m_context == context->m_context;
> c_iter = c_iter->next) {
> if (context->msgstate != OTRL_MSGSTATE_PLAINTEXT) return 1;
> }
> (...)
>
> I think the last if statement should check c_iter->msgstate instead of context->msgstate.
I think you are absolutely right here. Does not make sense to check the
context object again in that loop especially since it's not changing.
I just opened a ticket, see https://bugs.otr.im/issues/53 and attached
your proposed patch.
Thanks!
David
>
> Regards,
> Konrad
> _______________________________________________
> OTR-dev mailing list
> OTR-dev at lists.cypherpunks.ca
> http://lists.cypherpunks.ca/mailman/listinfo/otr-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 603 bytes
Desc: Digital signature
URL: <http://lists.cypherpunks.ca/pipermail/otr-dev/attachments/20140917/5edc3495/attachment.pgp>
More information about the OTR-dev
mailing list