Overly strict assertion in pj_sock_recfrom() for BSD

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

 



Hi Magnus,

I have just fixed this in r4233
(https://trac.pjsip.org/repos/changeset/4233). Thanks for the report.

Best regards,
Ming

On Tue, Aug 21, 2012 at 4:08 AM, Magnus Kempe <mkempe at cardinalpeak.com> wrote:
> 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
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



[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