Bug report r5781 (Ticket #2096)

CC
ciro.ciro@libero.it
Wed, Jun 13, 2018 10:09 AM

Hi all, I'd like to report a bug introduced with r5781 meant to solve Ticket #2096.

With these revision, if you call pjmedia_transport_srtp_create with NULL *opt argument (like it's done in streamutil sample):

pjproject\pjsip-apps\src\samples\streamutil.c :

status = pjmedia_transport_srtp_create(med_endpt, transport, NULL, &srtp_tp);

when you get here:

pjproject\pjmedia\src\pjmedia\transport_srtp.c

if (srtp->setting.crypto_count == 0 && opt->use != PJMEDIA_SRTP_DISABLED)

you have a nullptr exception because opt pointer was never set.

I guess it was meant to be like this:

if (srtp->setting.crypto_count == 0 && srtp->setting.use != PJMEDIA_SRTP_DISABLED)

The second bug I've found using streamutil sample with srtp is that when transport_media_start in pjproject\pjmedia\src\pjmedia\transport_srtp.c gets called from pjmedia_transport_media_start that in turn was called like this:

pjproject\pjsip-apps\src\samples\streamutil.c

/* Start media transport */
pjmedia_transport_media_start(transport, 0, 0, 0, 0);

it asserts because pool, sdp_local and sdp_remote are set to 0 :

pjproject\pjmedia\src\pjmedia\transport_srtp.c:

PJ_ASSERT_RETURN(tp && pool && sdp_local && sdp_remote, PJ_EINVAL);

Thanks, bye.

Hi all, I'd like to report a bug introduced with r5781 meant to solve Ticket #2096. With these revision, if you call pjmedia_transport_srtp_create with NULL *opt argument (like it's done in streamutil sample): pjproject\pjsip-apps\src\samples\streamutil.c : status = pjmedia_transport_srtp_create(med_endpt, transport, NULL, &srtp_tp); when you get here: pjproject\pjmedia\src\pjmedia\transport_srtp.c if (srtp->setting.crypto_count == 0 && opt->use != PJMEDIA_SRTP_DISABLED) you have a nullptr exception because opt pointer was never set. I guess it was meant to be like this: if (srtp->setting.crypto_count == 0 && srtp->setting.use != PJMEDIA_SRTP_DISABLED) The second bug I've found using streamutil sample with srtp is that when transport_media_start in pjproject\pjmedia\src\pjmedia\transport_srtp.c gets called from pjmedia_transport_media_start that in turn was called like this: pjproject\pjsip-apps\src\samples\streamutil.c /* Start media transport */ pjmedia_transport_media_start(transport, 0, 0, 0, 0); it asserts because pool, sdp_local and sdp_remote are set to 0 : pjproject\pjmedia\src\pjmedia\transport_srtp.c: PJ_ASSERT_RETURN(tp && pool && sdp_local && sdp_remote, PJ_EINVAL); Thanks, bye.
RS
Riza Sulistyo
Fri, Jun 22, 2018 5:16 PM

Hi Ciro,

Thanks for the report.
The fix was committed in r5811 https://trac.pjsip.org/repos/changeset/5811
.

Best Regards,

Riza

On Wed, Jun 13, 2018 at 5:09 PM, Ciro via pjsip pjsip@lists.pjsip.org
wrote:

Hi all, I'd like to report a bug introduced with r5781 meant to solve
Ticket #2096.

With these revision, if you call pjmedia_transport_srtp_create with NULL
*opt argument (like it's done in streamutil sample):

pjproject\pjsip-apps\src\samples\streamutil.c :

status = pjmedia_transport_srtp_create(med_endpt, transport, NULL,
&srtp_tp);

when you get here:

pjproject\pjmedia\src\pjmedia\transport_srtp.c

if (srtp->setting.crypto_count == 0 && opt->use != PJMEDIA_SRTP_DISABLED)

you have a nullptr exception because opt pointer was never set.

I guess it was meant to be like this:

if (srtp->setting.crypto_count == 0 && srtp->setting.use !=
PJMEDIA_SRTP_DISABLED)

The second bug I've found using streamutil sample with srtp is
that when transport_media_start in pjproject\pjmedia\src\pjmedia\transport_srtp.c
gets called from pjmedia_transport_media_start that in turn was called
like this:

pjproject\pjsip-apps\src\samples\streamutil.c

/* Start media transport */
pjmedia_transport_media_start(transport, 0, 0, 0, 0);

it asserts because pool, sdp_local and sdp_remote are set to 0 :

pjproject\pjmedia\src\pjmedia\transport_srtp.c:

PJ_ASSERT_RETURN(tp && pool && sdp_local && sdp_remote, PJ_EINVAL);

Thanks, bye.


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

Hi Ciro, Thanks for the report. The fix was committed in r5811 <https://trac.pjsip.org/repos/changeset/5811> . Best Regards, Riza On Wed, Jun 13, 2018 at 5:09 PM, Ciro via pjsip <pjsip@lists.pjsip.org> wrote: > Hi all, I'd like to report a bug introduced with r5781 meant to solve > Ticket #2096. > > With these revision, if you call pjmedia_transport_srtp_create with NULL > *opt argument (like it's done in streamutil sample): > > > *pjproject\pjsip-apps\src\samples\streamutil.c* : > > status = pjmedia_transport_srtp_create(med_endpt, transport, NULL, > &srtp_tp); > > when you get here: > > *pjproject\pjmedia\src\pjmedia\transport_srtp.c* > > if (srtp->setting.crypto_count == 0 && opt->use != PJMEDIA_SRTP_DISABLED) > > you have a nullptr exception because opt pointer was never set. > > I guess it was meant to be like this: > > if (srtp->setting.crypto_count == 0 && srtp->setting.use != > PJMEDIA_SRTP_DISABLED) > > > The second bug I've found using streamutil sample with srtp is > that when transport_media_start in pjproject\pjmedia\src\pjmedia\transport_srtp.c > gets called from pjmedia_transport_media_start that in turn was called > like this: > > > *pjproject\pjsip-apps\src\samples\streamutil.c* > > /* Start media transport */ > pjmedia_transport_media_start(transport, 0, 0, 0, 0); > > > it asserts because pool, sdp_local and sdp_remote are set to 0 : > > *pjproject\pjmedia\src\pjmedia\transport_srtp.c:* > > PJ_ASSERT_RETURN(tp && pool && sdp_local && sdp_remote, PJ_EINVAL); > > > > Thanks, bye. > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > >