STUN server, NULL int pointer, exc_bad_access

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

 



On Tue, May 25, 2010 at 9:15 PM, Joe Meade <xmeadex at gmail.com> wrote:
> Hi all,
> I'm trying to setup a connection to a STUN server and have what seems a bug
> to me. Can someone confirm this is a bug or let me know what I'm doing
> wrong?
> The method resolve_stun_entry passes a NULL value for a pointer to an
> integer. The target method (pj_sockaddr_parse2) tests that value in a
> BOOLEAN if statement, which causes an EXC_BAD_ACCESS error.
> pjsua_core.c:1014
>
> static void resolve_stun_entry(pjsua_stun_resolve *sess)
>
> ..
>
> /* Parse the server entry into host:port */
>
> sess->status = pj_sockaddr_parse2(af, 0, &sess->srv[sess->idx],
>
> ? &hostpart, &port, NULL); // last param causes error
>
> __________
> sock_common.c:461
>
> PJ_DEF(pj_status_t) pj_sockaddr_parse2(int af, unsigned options,
>
> ? ? ? const pj_str_t *str,
>
> ? ? ? pj_str_t *p_hostpart,
>
> ? ? ? pj_uint16_t *p_port,
>
> ? ? ? int *raf)
>
> {
>
> ..
>
> if (*raf) // <-- crash happens here
>

Hi,

Yep, that's a silly bug, it should have been "if (raf)" instead! I
just fixed this in latest SVN.


> ? ? *raf = PJ_AF_INET;
>
> Has anyone else run into this?
> Does anyone else have this working against a STUN server?

I know that was a silly bug, but believe me we use STUN a lot, and I'm
sure others too.

I think the problem might be because you set the STUN server to an empty string?

Thanks
 Benny

> Thanks very much,
> --
> Joe Meade
>
>
> _______________________________________________
> 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