bug: thread safety problem with pjsua_buddy_get_info

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bug report:

Among the things returned by pjsua_buddy_get_info is info.pres_status[n].tuple_node, a pj_xml_node pointer.

Since this xml tree isn't deep-copied by pjsua_buddy_get_info, usage of this pointer is not thread-safe.

At minimum, the documentation for this call should have a warning against using this field.??

Question:


Since my code actually does need the tuple info, I'm going to modify my pjsua to either expose the lock_buddy
call, or add something like
?? pjsua_buddy_call_with_info(pjsua_buddy_id,? void (*)(pjsua_buddy_id, pjsua_buddy_info *, void *user_data))

which would call the provided function with the lock held, so that the tuple data was safe to use.

Does that sound like correct behavior?? Does holding the buddy's dialog log guarantee that the tuple data is safe to use?

I will provide a patch if my code seems clean enough.


-m@
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120227/39b76366/attachment.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux