Hi,<br><br>I was trying to set up media proxy module and after some time of debuging I discovered that the problems<br>were in the get_from_did(&did, msg) function. in mediaproxy.c file in line 469 there is such piece of code:
<br> if (get_from_did(&did, msg) == 0) {<br> *type = "local";<br> return did;<br> }<br><br>when this code is invoked the result is wrong. this is some nowhere pointer with the length of the field unpredictable.
<br>after this invocation there is another piece of code wich tries to allocate some memory baseing on the length of the did string.(line 1449)<br> cmdlen = callId.len + strlen(clientIP) + fromDomain.len + toDomain.len
+<br>
userAgent.len*3 + infolen + 128;<br> command = pkg_malloc(cmdlen);<br> if (!command) {<br> LOG(L_ERR, "error: use_media_proxy() - (!command): out of memory\n");<br> return -1;<br> }<br><br>
this causes out of memory error when value of fromDomain.len gives random big number(below example of one my shots)<br>Dec 2 18:17:17 rd ser[5884]: route[MEDIA]: use_media_proxy()<br>Dec 2 18:17:17 rd ser[5884]: error: get_from_did - true
<br>Dec 2 18:17:17 rd ser[5884]: error: callId.len: 44<br>Dec 2 18:17:17 rd ser[5884]: error: strlen(clientIP): 14<br>Dec 2 18:17:17 rd ser[5884]: error: fromDomain.len: 1235653920<br>Dec 2 18:17:17 rd ser[5884]: error:
toDomain.len: 14<br>Dec 2 18:17:17 rd ser[5884]: error: userAgent.len*3: 96<br>Dec 2 18:17:17 rd ser[5884]: error: infolen: 107<br>Dec 2 18:17:17 rd ser[5884]: error: cmdlen 1235654349<br>Dec 2 18:17:17 rd ser[5884]: error: use_media_proxy() - (!command): out of memory
<br><br>please, can someone check this and fix<br><br>best regards<br>tomasz<br><br><br><br><br>