assertion/crash in pjpidf_status_is_basic_open (with patch)

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

 



On Fri, Sep 9, 2011 at 5:30 AM, Matt DiMeo <mattdimeo at yahoo.com> wrote:
> When parsing pidf bodies, pjsip 1.10 crashes if it encounters a <tuple> node
> without a <basic> under <status>.? As I read RFC3863, section 4.1.3, the
> <basic> node is OPTIONAL, and so this is out of spec.
> I propose this patch as a fix, but it's possible I'm missing something.? If
> so, please enlighten me.

You're right! I just committed your patch in
https://trac.pjsip.org/repos/ticket/1367. In addition, I also add null
checking in pjpidf_status_set_basic_open(), just in case.

Thanks!

 Benny


> Index: pjsip/src/pjsip-simple/pidf.c
> ===================================================================
> --- pjsip/src/pjsip-simple/pidf.c??? (revision 38299)
> +++ pjsip/src/pjsip-simple/pidf.c??? (working copy)
> @@ -324,7 +324,8 @@
> ?PJ_DEF(pj_bool_t) pjpidf_status_is_basic_open(const pjpidf_status *st)
> ?{
> ???? pj_xml_node *node = pj_xml_find_node((pj_xml_node*)st, &BASIC);
> -??? pj_assert(node != NULL);
> +??? if (node == NULL)
> +??????? return PJ_FALSE ;
> ???? return pj_stricmp(&node->content, &OPEN)==0;
> ?}
>



[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