Overly strict assertion in pj_sock_recfrom() for BSD

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

 



In pjlib/src/pj/sock_bsd.c
the following assertion appears under PJ_DEF(pj_status_t)
pj_sock_recvfrom(...)


    PJ_ASSERT_RETURN(from && fromlen, (*len=-1, PJ_EINVAL));


However that should not be a requirement to call recvfrom(). The parameters
from and fromlen should be allowed to be NULL.

Removing that assertion allows one to make the following call

    status = pj_sock_recvfrom (my_sock,
      buf, &byte_count, 0,
      // from is ignored.
      NULL, NULL);

I noticed that there is no such ASSERT in the Linux version of the library.

thanks.
-- 
Magnus Kempe, Cardinal Peak | mkempe at cardinalpeak.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20120820/f187bd21/attachment-0001.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