Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane

From: Askar Safin <safinaskar <at> mail.ru>
Subject: [BUG] [PATCH] Undefined variable makes Icedemo unusable
Newsgroups: gmane.comp.voip.pjsip
Date: Tuesday 2nd October 2012 19:39:00 UTC (over 6 years ago)
Hi, this is very-very important bug report (with patch). I didn't find
where to send bug reports, so I sent it here.

Program: Icedemo

Priority: Critical (this bug can make Icedemo completly unusable)

How to reproduce: run icedemo with the following command line under Linux:

/icedemo -s stunserver.org -t 188.44.56.155 -u test -p 1234

(here 188.44.56.155 is my IP with my testing TURN server, this doesn't
matter)

Then type "c", "i o" and "s".

I see the following output (of last command, i. e. "s"):
v=0
o=- 3414953978 3414953978 IN IP4 localhost
s=ice
t=0 0
a=ice-ufrag:4db127f8
a=ice-pwd:0216231b
m=audio 49162 RTP/AVP 0
c=IN IP4 188.44.56.155

This output doesn't contain "a=candidate" line (for me; this bug is very
volatile), so, it doesn't contain any candidates. But this is wrong and the
output should contain candidates, because:

1. I have the global IP, so the list must contain it
2. I have working TURN server, so the list must contain it

If I paste this output to another Icedemo instance, it will say: "icedemo.c
!Error: not enough info", because the list doesn't contain candidates.

Reason of this bug is unset/undefined variable :) Variable "cand_cnt" (see
patch) is undefined, and sometimes it is equal to 0. In this cases,
pj_ice_strans_enum_cands(...) receives 0 as its argument, so it doesn't
write candidates to cand[] array.

Best regards, Askar Safin

Patch for 2.0.1:

diff -Naur
/w/dev/pjsip/pjproject-2.0.1-orig/pjsip-apps/src/samples/icedemo.c
/w/dev/pjsip/pjproject-2.0.1/pjsip-apps/src/samples/icedemo.c
--- /w/dev/pjsip/pjproject-2.0.1-orig/pjsip-apps/src/samples/icedemo.c 
2012-09-30 17:24:40.000000000 +0000
+++ /w/dev/pjsip/pjproject-2.0.1/pjsip-apps/src/samples/icedemo.c      
2012-09-30 17:25:12.000000000 +0000
@@ -579,7 +579,7 @@
 
     /* Write each component */
     for (comp=0; comp
				
			
 
CD: 14ms